Skip to content

Commit

Permalink
ci refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kovstas committed Jun 1, 2024
1 parent 66023a7 commit e616ab1
Showing 1 changed file with 61 additions and 91 deletions.
152 changes: 61 additions & 91 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build
on:
push:
branches: [ main ]
tags: ["*"]
tags: [ "*" ]
paths-ignore:
- '**/*.md'
pull_request:
Expand All @@ -16,44 +16,30 @@ jobs:
name: Build and Test
strategy:
matrix:
os: [ubuntu-22.04]
scala: [3.4.2, 2.12.19, 2.13.14]
java: [temurin@17]
project: [rootJS, root, rootNative]
os: [ ubuntu-latest ]
scala: [ 2.12, 2.13, 3 ]
java: [ temurin@17 ]
project: [ rootJS, root, rootNative ]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v1
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: jdkfile
distribution: temurin
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}
cache: sbt

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Install brew formulae (ubuntu)
if: (matrix.project == 'rootNative') && startsWith(matrix.os, 'ubuntu')
Expand Down Expand Up @@ -84,7 +70,7 @@ jobs:

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
path: targets.tar
Expand All @@ -95,122 +81,106 @@ jobs:
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
strategy:
matrix:
os: [ ubuntu-22.04 ]
scala: [ 2.13.14 ]
os: [ ubuntu-latest ]
java: [ temurin@17 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v1
with:
distribution: temurin
java-version: 17

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: jdkfile
distribution: temurin
java-version: 17
jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }}
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
run: sbt +update

- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}

- name: Download target directories (3.4.2, rootJS)
uses: actions/download-artifact@v2
- name: Download target directories (3, rootJS)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.4.2-rootJS
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJS

- name: Inflate target directories (3.4.2, rootJS)
- name: Inflate target directories (3, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.4.2, root)
uses: actions/download-artifact@v2
- name: Download target directories (3, root)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.4.2-root
name: target-${{ matrix.os }}-${{ matrix.java }}-3-root

- name: Inflate target directories (3.4.2, root)
- name: Inflate target directories (3, root)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (3.4.2, rootNative)
uses: actions/download-artifact@v2
- name: Download target directories (3, rootNative)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.4.2-rootNative
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootNative

- name: Inflate target directories (3.4.2, rootNative)
- name: Inflate target directories (3, rootNative)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12.19, rootJS)
uses: actions/download-artifact@v2
- name: Download target directories (2.12, rootJS)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.19-rootJS
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS

- name: Inflate target directories (2.12.19, rootJS)
- name: Inflate target directories (2.12, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12.19, root)
uses: actions/download-artifact@v2
- name: Download target directories (2.12, root)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.19-root
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-root

- name: Inflate target directories (2.12.19, root)
- name: Inflate target directories (2.12, root)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.12.19, rootNative)
uses: actions/download-artifact@v2
- name: Download target directories (2.12, rootNative)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.19-rootNative
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootNative

- name: Inflate target directories (2.12.19, rootNative)
- name: Inflate target directories (2.12, rootNative)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.14, rootJS)
uses: actions/download-artifact@v2
- name: Download target directories (2.13, rootJS)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.14-rootJS
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS

- name: Inflate target directories (2.13.14, rootJS)
- name: Inflate target directories (2.13, rootJS)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.14, root)
uses: actions/download-artifact@v2
- name: Download target directories (2.13, root)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.14-root
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-root

- name: Inflate target directories (2.13.14, root)
- name: Inflate target directories (2.13, root)
run: |
tar xf targets.tar
rm targets.tar
- name: Download target directories (2.13.14, rootNative)
uses: actions/download-artifact@v2
- name: Download target directories (2.13, rootNative)
uses: actions/download-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.14-rootNative
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative

- name: Inflate target directories (2.13.14, rootNative)
- name: Inflate target directories (2.13, rootNative)
run: |
tar xf targets.tar
rm targets.tar
Expand Down

0 comments on commit e616ab1

Please sign in to comment.