Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
rpiaggio committed Jun 30, 2023
1 parent 61e98e9 commit 6438d57
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 90 deletions.
174 changes: 90 additions & 84 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,75 +15,58 @@ on:
tags: [v*]

env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


concurrency:
group: ${{ github.workflow }} @ ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build and Test
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.10, 3.3.0]
scala: [2.13, 3]
java: [temurin@11, temurin@17]
project: [rootJS, rootJVM]
exclude:
- project: rootJS
java: temurin@17
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0

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

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

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17
- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' reload +update

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

- name: Cache sbt
uses: actions/cache@v3
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 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' reload +update

- name: Check that workflows are up to date
run: sbt githubWorkflowCheck
Expand All @@ -92,21 +75,25 @@ jobs:
if: matrix.java == 'temurin@11'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck lucumaScalafmtCheck lucumaScalafixCheck

- name: Check scalafix lints
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' 'scalafixAll --check'

- name: scalaJSLink
if: matrix.project == 'rootJS'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult

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

- name: Check scalafix lints
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' 'scalafixAll --check'

- name: Check binary compatibility
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues

- name: Generate API documentation
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc

- name: Aggregate coverage reports
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' coverageReport coverageAggregate

Expand All @@ -120,7 +107,6 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.10]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -129,91 +115,111 @@ jobs:
with:
fetch-depth: 0

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

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

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 17
- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt reload +update

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

- name: Cache sbt
uses: actions/cache@v3
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 reload +update

- name: Import signing key
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: echo $PGP_SECRET | base64 -di | gpg --import

- name: Import signing key and strip passphrase
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: |
echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
(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 }}' tlCiRelease

validate-steward:
name: Validate Steward Config
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
run: sbt tlCiRelease

dependency-submission:
name: Submit Dependencies
if: github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.6]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download Java (temurin@17)
id: download-java-temurin-17
if: matrix.java == 'temurin@17'
uses: typelevel/download-java@v2
- name: Setup Java (temurin@11)
id: setup-java-temurin-11
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 11
cache: sbt

- name: sbt update
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
run: sbt '++ ${{ matrix.scala }}' reload +update

- name: Setup Java (temurin@17)
id: setup-java-temurin-17
if: matrix.java == 'temurin@17'
uses: actions/setup-java@v3
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 '++ ${{ matrix.scala }}' reload +update

- name: Submit Dependencies
uses: scalacenter/sbt-dependency-submission@v2
with:
modules-ignore: genTests genInput root rootJS genOutput rootJVM rootNative http4sJDKDemo
configs-ignore: test scala-tool scala-doc-tool

validate-steward:
name: Validate Steward Config
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (fast)
uses: actions/checkout@v3

- uses: coursier/setup-action@v1
with:
Expand Down
12 changes: 6 additions & 6 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ pull_request_rules:
- body~=labels:.*early-semver-patch
- body~=labels:.*early-semver-minor
- 'title=flake.lock: Update'
- status-success=Build and Test (ubuntu-latest, 2.13.10, temurin@11, rootJS)
- status-success=Build and Test (ubuntu-latest, 2.13.10, temurin@11, rootJVM)
- status-success=Build and Test (ubuntu-latest, 2.13.10, temurin@17, rootJVM)
- status-success=Build and Test (ubuntu-latest, 3.3.0, temurin@11, rootJS)
- status-success=Build and Test (ubuntu-latest, 3.3.0, temurin@11, rootJVM)
- status-success=Build and Test (ubuntu-latest, 3.3.0, temurin@17, rootJVM)
- status-success=Build and Test (ubuntu-latest, 2.13, temurin@11, rootJS)
- status-success=Build and Test (ubuntu-latest, 2.13, temurin@11, rootJVM)
- status-success=Build and Test (ubuntu-latest, 2.13, temurin@17, rootJVM)
- status-success=Build and Test (ubuntu-latest, 3, temurin@11, rootJS)
- status-success=Build and Test (ubuntu-latest, 3, temurin@11, rootJVM)
- status-success=Build and Test (ubuntu-latest, 3, temurin@17, rootJVM)
actions:
merge: {}
- name: Label core PRs
Expand Down

0 comments on commit 6438d57

Please sign in to comment.