Merge pull request #78 from scala-steward/update/de.tobiasroeser.mill… #199
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Scala CI | |
on: | |
push: | |
branches: [main] | |
tags: ["*"] | |
pull_request: | |
branches: ["*"] | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
strategy: | |
matrix: | |
jvm: ["11", "17"] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: ${{ matrix.jvm }} | |
version: "latest" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
components: "native-image" | |
- name: Cache packages | |
uses: coursier/cache-action@v6 | |
id: coursier-cache | |
- name: Check Formatting | |
run: ./mill mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources | |
if: startsWith(matrix.jvm, '17') | |
# - name: Run tests for all versions | |
# run: ./mill testall | |
# code-coverage: | |
# needs: [test] | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# with: | |
# fetch-depth: 0 | |
# - name: Setup Java | |
# uses: actions/setup-java@v3 | |
# with: | |
# distribution: 'temurin' | |
# java-version: 17 | |
# - name: Cache packages | |
# uses: coursier/cache-action@v6 | |
# id: coursier-cache | |
# - name: Run code coverage | |
# run: ./mill coverage | |
# - name: Upload coverage to Codecov | |
# uses: codecov/codecov-action@v3 | |
publish-snapshot: | |
needs: [test] | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: "17" | |
version: "latest" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
components: "native-image" | |
- name: Cache packages | |
uses: coursier/cache-action@v6 | |
id: coursier-cache | |
- name: Publish | |
run: ./mill Alias/run pub | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
publish-release: | |
needs: [test] | |
runs-on: ubuntu-latest | |
if: contains(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: "17" | |
version: "latest" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
components: "native-image" | |
- name: Cache packages | |
uses: coursier/cache-action@v6 | |
id: coursier-cache | |
- name: Publish | |
run: ./mill Alias/run pub | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
- name: Publish release from tag | |
uses: ghalactic/github-release-from-tag@v5 | |
with: | |
generateReleaseNotes: "true" | |
prerelease: "false" | |
draft: "false" |