Skip to content

Commit

Permalink
GitHub Actions: Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-lee committed Nov 12, 2024
1 parent 8f68f61 commit 2cef2d9
Showing 1 changed file with 40 additions and 76 deletions.
116 changes: 40 additions & 76 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,50 +29,41 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
scala: [3.3.4, 2.12.18, 2.13.11]
java: [temurin@17, temurin@21]
scala: ["3.3.4", "2.12.18", "2.13.11"]
java:
- { java-version: "17", java-distribution: "temurin" }
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@21)
if: matrix.java == 'temurin@21'
- name: Setup Java (${{ matrix.java.java-distribution }}@${{ matrix.java.java-version }})
uses: actions/[email protected]
with:
distribution: temurin
java-version: 21
distribution: ${{ matrix.java.java-distribution }}
java-version: ${{ matrix.java.java-version }}
cache: 'sbt'
- uses: sbt/setup-sbt@v1

- name: Check that workflows are up to date
run: sbt '++${{ matrix.scala }}!' 'project /' githubWorkflowCheck
# - name: Check that workflows are up to date
# run: sbt '++${{ matrix.scala }}' 'project /' githubWorkflowCheck

- name: Test
run: sbt '++${{ matrix.scala }}!' test
run: sbt '++${{ matrix.scala }}' test

- name: Check binary compatibility
if: matrix.java == 'temurin@17'
run: sbt '++${{ matrix.scala }}!' mimaReportBinaryIssues
run: sbt '++${{ matrix.scala }}' mimaReportBinaryIssues

- name: Generate API documentation
if: matrix.java == 'temurin@17'
run: sbt '++${{ matrix.scala }}!' doc
run: sbt '++${{ matrix.scala }}' doc

- name: Check Scalafix rules
if: matrix.scala != '3.3.4'
run: sbt '++${{ matrix.scala }}!' 'scalafixAll --check'
run: sbt '++${{ matrix.scala }}' 'scalafixAll --check'

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.22')
Expand All @@ -86,7 +77,7 @@ jobs:
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/series/0.22')
uses: actions/upload-artifact@v4
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}
name: target-${{ matrix.os }}-${{ matrix.java.java-distribution }}@${{ matrix.java.java-version }}-${{ matrix.scala }}
path: targets.tar

publish:
Expand All @@ -97,36 +88,27 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13.11]
java: [temurin@17]
java:
- { java-version: "17", java-distribution: "temurin" }
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@21)
if: matrix.java == 'temurin@21'
- name: Setup Java (${{ matrix.java.java-distribution }}@${{ matrix.java.java-version }})
uses: actions/[email protected]
with:
distribution: temurin
java-version: 21
distribution: ${{ matrix.java.java-distribution }}
java-version: ${{ matrix.java.java-version }}
cache: 'sbt'
- uses: sbt/setup-sbt@v1

- name: Download target directories (3.3.4)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.4
name: target-${{ matrix.os }}-${{ matrix.java.java-distribution }}@${{ matrix.java.java-version }}-3.3.4

- name: Inflate target directories (3.3.4)
run: |
Expand All @@ -136,7 +118,7 @@ jobs:
- name: Download target directories (2.12.18)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.18
name: target-${{ matrix.os }}-${{ matrix.java.java-distribution }}@${{ matrix.java.java-version }}-2.12.18

- name: Inflate target directories (2.12.18)
run: |
Expand All @@ -146,7 +128,7 @@ jobs:
- name: Download target directories (2.13.11)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11
name: target-${{ matrix.os }}-${{ matrix.java.java-distribution }}@${{ matrix.java.java-version }}-2.13.11

- name: Inflate target directories (2.13.11)
run: |
Expand All @@ -156,7 +138,7 @@ jobs:
- name: Download target directories (2.13.11)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11
name: target-${{ matrix.os }}-${{ matrix.java.java-distribution }}@${{ matrix.java.java-version }}-2.13.11

- name: Inflate target directories (2.13.11)
run: |
Expand All @@ -166,7 +148,7 @@ jobs:
- name: Download target directories (2.13.11)
uses: actions/download-artifact@v2
with:
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11
name: target-${{ matrix.os }}-${{ matrix.java.java-distribution }}@${{ matrix.java.java-version }}-2.13.11

- name: Inflate target directories (2.13.11)
run: |
Expand All @@ -185,37 +167,28 @@ jobs:
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
- name: Publish
run: sbt '++${{ matrix.scala }}!' tlRelease
run: sbt '++${{ matrix.scala }}' tlRelease

scalafix:
name: Scalafix
strategy:
matrix:
os: [ubuntu-latest]
scala: [3.3.4, 2.12.18, 2.13.11]
java: [temurin@17]
scala: ["3.3.4", "2.12.18", "2.13.11"]
java:
- { java-version: "17", java-distribution: "temurin" }
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@21)
if: matrix.java == 'temurin@21'
- name: Setup Java (${{ matrix.java.java-distribution }}@${{ matrix.java.java-version }})
uses: actions/[email protected]
with:
distribution: temurin
java-version: 21
distribution: ${{ matrix.java.java-distribution }}
java-version: ${{ matrix.java.java-version }}
cache: 'sbt'
- uses: sbt/setup-sbt@v1

Expand All @@ -231,34 +204,25 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13.11]
java: [temurin@17]
java:
- { java-version: "17", java-distribution: "temurin" }
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Java (temurin@17)
if: matrix.java == 'temurin@17'
uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@v1

- name: Setup Java (temurin@21)
if: matrix.java == 'temurin@21'
- name: Setup Java (${{ matrix.java.java-distribution }}@${{ matrix.java.java-version }})
uses: actions/[email protected]
with:
distribution: temurin
java-version: 21
distribution: ${{ matrix.java.java-distribution }}
java-version: ${{ matrix.java.java-version }}
cache: 'sbt'
- uses: sbt/setup-sbt@v1

- name: Generate site
run: sbt '++${{ matrix.scala }}!' site/tlSite
run: sbt '++${{ matrix.scala }}' site/tlSite

- name: Publish site
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/series/0.22'
Expand Down

0 comments on commit 2cef2d9

Please sign in to comment.