diff --git a/.github/workflows/build.yml b/.github/workflows/publish-artifacts.yml similarity index 50% rename from .github/workflows/build.yml rename to .github/workflows/publish-artifacts.yml index cef07165..5889f39e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/publish-artifacts.yml @@ -1,76 +1,14 @@ -name: ci +name: Publish Artifacts on: push: - branches: - - main - pull_request: - branches: - - main + tags: + - '**' + workflow_dispatch: jobs: - test: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - java-version: [8, 17] - include: - - os: macos-latest - java-version: 17 - - os: macos-latest - java-version: 11 - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: ${{ matrix.java-version }} - - name: Fetch millw launcher (Windows) - run: curl -Lo mill.bat "https://raw.githubusercontent.com/lefou/millw/main/millw.bat" - if: matrix.os == 'windows-latest' - - - run: ./mill -i -k __.test - if: matrix.os != 'windows-latest' - - run: ./mill.bat -i -k __.jvm.__.test - if: matrix.os == 'windows-latest' - - check-bin-compat: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 8 - - - run: ./mill -i -k __.mimaReportBinaryIssues - - check-formatting: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - - run: ./mill -i mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources - publish-sonatype: - if: github.repository == 'com-lihaoyi/os-lib' && contains(github.ref, 'refs/tags/') + if: github.repository == 'com-lihaoyi/os-lib' needs: test runs-on: ubuntu-latest env: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 00000000..03bb729b --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,70 @@ +name: Run Tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + java-version: [8, 17] + include: + - os: macos-latest + java-version: 17 + - os: macos-latest + java-version: 11 + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java-version }} + - name: Fetch millw launcher (Windows) + run: curl -Lo mill.bat "https://raw.githubusercontent.com/lefou/millw/main/millw.bat" + if: matrix.os == 'windows-latest' + + - run: ./mill -i -k __.test + if: matrix.os != 'windows-latest' + - run: ./mill.bat -i -k __.jvm.__.test + if: matrix.os == 'windows-latest' + + check-bin-compat: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 8 + + - run: ./mill -i -k __.mimaReportBinaryIssues + + check-formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 17 + + - run: ./mill -i mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources