lamianr update #295
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: ['**', '!update/**', '!pr/**'] | |
| tags: [v*] | |
| env: | |
| 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: [3] | |
| java: [temurin@17] | |
| project: [jvm] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: taiki-e/install-action@just | |
| - uses: coursier/setup-action@main | |
| with: | |
| jvm: temurin@17 | |
| apps: scala-cli | |
| - name: Checkout current branch (full) | |
| uses: actions/checkout@main | |
| with: | |
| fetch-depth: 0 | |
| - name: Install required libraries | |
| run: sudo apt-get update && sudo apt-get install -y libgtk-4-dev libgraphene-1.0-dev libavif-dev | |
| - name: Cache Playwright dependencies | |
| id: cache-pw | |
| uses: actions/cache@main | |
| with: | |
| path: /home/runner/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('playwrightVersion.mill') }} | |
| restore-keys: | | |
| playwright-${{ runner.os }}-${{ hashFiles('playwrightVersion.mill') }} | |
| - name: formatCheck | |
| run: ./mill mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources | |
| - name: Install Playwright | |
| run: just setupPlaywright | |
| - name: compile | |
| run: ./mill __.compile | |
| # Sometimes the tests will timeout if they have to fetch all the transitive scala-js deps the first time... let's have coursier put them in the cache | |
| - name: cache test deps | |
| run: | | |
| cs fetch com.raquo:laminar_sjs1_3:17.2.0 | |
| cs fetch org.scala-js:scalajs-dom_sjs1_3:2.8.0 | |
| - name: Test | |
| run: ./mill __.test | |
| publish: | |
| if: github.repository == 'Quafadas/live-server-scala-cli-js' && contains(github.ref, 'refs/tags/') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@main | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - uses: coursier/setup-action@main | |
| with: | |
| jvm: temurin@17 | |
| apps: scala-cli | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@v6 | |
| with: | |
| gpg_private_key: ${{ secrets.PGP_SECRET }} | |
| passphrase: ${{ secrets.PUBLISH_SECRET_KEY_PASSWORD }} | |
| git_config_global: true | |
| - name: Prepare GPG | |
| run: | | |
| echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf | |
| gpgconf --reload gpg-agent | |
| - name: List keys | |
| run: gpg -K | |
| - name: Publish to Maven Central | |
| run: ./mill -i mill.scalalib.PublishModule/publishAll --sonatypeUri https://s01.oss.sonatype.org/service/local --sonatypeCreds "${{ secrets.PUBLISH_USER }}:${{ secrets.PUBLISH_PASSWORD }}" --gpgArgs "--passphrase=${{ secrets.PUBLISH_SECRET_KEY_PASSWORD}},--batch,--yes,-a,-b,--pinentry-mode,loopback" --readTimeout 1200000 --awaitTimeout 1200000 --release true --signed true | |
| site: | |
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: coursier/setup-action@main | |
| with: | |
| jvm: temurin@17 | |
| apps: scala-cli | |
| - uses: actions/checkout@main | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - run: ./mill site.publishDocs | |
| - name: Setup Pages | |
| uses: actions/configure-pages@main | |
| - uses: actions/upload-artifact@main | |
| with: | |
| name: page | |
| path: out/site/publishDocs.dest | |
| if-no-files-found: error | |
| deploy: | |
| 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 |