Vecxt IO #846
This file contains hidden or 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: Continuous Integration | |
| on: | |
| pull_request: | |
| branches: ['**', '!update/**', '!pr/**'] | |
| push: | |
| branches: [main] | |
| tags: [v*] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| FORCE_COLOR: '1' | |
| concurrency: | |
| group: ${{ github.workflow }} @ ${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build and Test | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| scala: [3] | |
| java: [temurin@17] | |
| project: [js, jvm, native] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout current branch (full) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: coursier/setup-action@main | |
| with: | |
| jvm: temurin@17 | |
| apps: scala-cli | |
| - name: Cache Coursier | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/coursier/v1 | |
| key: coursier-${{ runner.os }}-${{ hashFiles('build.mill', '**/package.mill') }} | |
| restore-keys: coursier-${{ runner.os }}- | |
| - name: Setup NodeJS v18 LTS | |
| if: matrix.project == 'js' | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: formatCheck | |
| if: matrix.project == 'jvm' | |
| run: ./mill mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources | |
| - if: matrix.project == 'js' | |
| run: npm install | |
| - if: matrix.project == 'native' | |
| run: sudo apt-get install -y libatlas-base-dev | |
| - name: scalaJSLink | |
| if: matrix.project == 'js' | |
| run: ./mill vecxt.${{ matrix.project }}.fastLinkJS | |
| - name: nativeLink | |
| if: matrix.project == 'native' | |
| run: ./mill vecxt.${{ matrix.project }}.test.nativeLink | |
| - name: Test | |
| run: ./mill vecxt.${{ matrix.project }}.test | |
| - name: Test | |
| run: ./mill vecxtensions.${{ matrix.project }}.test | |
| - name: Test | |
| run: ./mill vecxt_re.${{ matrix.project }}.test | |
| - name: Laws Test | |
| if: matrix.project == 'jvm' | |
| run: ./mill laws.${{ matrix.project }}.test | |
| - name: Doc Gen | |
| if: matrix.project == 'jvm' | |
| run: ./mill site.siteGen | |
| - name: Publish Test Report | |
| uses: mikepenz/action-junit-report@v5 | |
| if: always() | |
| with: | |
| fail_on_failure: false | |
| include_passed: false | |
| detailed_summary: true | |
| annotate_only: true | |
| require_tests: false | |
| report_paths: 'out/**/test-report.xml' | |
| publish: | |
| if: github.repository == 'Quafadas/vecxt' && contains(github.ref, 'refs/tags/') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - uses: coursier/setup-action@main | |
| with: | |
| jvm: temurin@17 | |
| apps: scala-cli | |
| - name: Cache Coursier | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/coursier/v1 | |
| key: coursier-${{ runner.os }}-${{ hashFiles('build.mill', '**/package.mill') }} | |
| restore-keys: coursier-${{ runner.os }}- | |
| - name: Publish to Maven Central | |
| run: ./mill mill.javalib.SonatypeCentralPublishModule/ | |
| env: | |
| MILL_PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
| MILL_PGP_SECRET_BASE64: ${{ secrets.PGP_SECRET }} | |
| MILL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| MILL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| site: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: coursier/setup-action@main | |
| with: | |
| jvm: temurin@17 | |
| apps: scala-cli | |
| - name: Cache Coursier | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/coursier/v1 | |
| key: coursier-${{ runner.os }}-${{ hashFiles('build.mill', '**/package.mill') }} | |
| restore-keys: coursier-${{ runner.os }}- | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| ref: benchmark | |
| - name: Aggregate benchmark results | |
| run: | | |
| chmod +x aggregate.sh | |
| ./aggregate.sh | |
| - name: Switch to target branch | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| git fetch origin ${{ github.head_ref }} | |
| git checkout -f ${{ github.head_ref }} | |
| git reset --hard origin/${{ github.head_ref }} | |
| else | |
| git fetch origin main | |
| git checkout -f main | |
| git reset --hard origin/main | |
| fi | |
| ls | |
| - name: Copy benchmark results into docs generation | |
| run: mkdir -p site/docs/_assets/benchmarks && cp benchmark_history.json site/docs/_assets/benchmarks/benchmark_history.json | |
| - name: Generate static site | |
| run: ./mill site.siteGen | |
| - name: Setup Pages | |
| uses: actions/configure-pages@main | |
| - uses: actions/upload-artifact@main | |
| with: | |
| name: page | |
| path: out/site/laika/generateSite.dest | |
| if-no-files-found: error | |
| deploy: | |
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | |
| needs: site | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@main | |
| with: | |
| name: page | |
| path: . | |
| - uses: actions/configure-pages@main | |
| - uses: actions/upload-pages-artifact@main | |
| with: | |
| path: . | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@main |