fix typo (#45) #476
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: CI | |
| on: | |
| # Runs on pushes targeting the default branch | |
| push: | |
| branches: [main] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Cancel in-progress runs when a new commit is pushed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_and_test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: wireit caching | |
| uses: google/wireit@setup-github-actions-caching/v2 | |
| - name: Install NPM dependencies. | |
| run: npm ci | |
| # Wireit will automatically use the GitHub Actions cache whenever possible.ß | |
| - name: Build repo | |
| run: npm run build | |
| # Wireit will automatically use the GitHub Actions cache whenever possible. | |
| - name: Run tests. | |
| run: npm run test | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: website/dist | |
| deploy: | |
| # Add a dependency to the build job | |
| needs: build_and_test | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| # Deploy to the github-pages environment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| # Specify runner + deployment step | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action | |
| benchmark: | |
| # Add a dependency to the build job | |
| needs: build_and_test | |
| # Specify runner + deployment step | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # Needed to push to the stats repository | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: wireit caching | |
| uses: google/wireit@setup-github-actions-caching/v2 | |
| - name: Install NPM dependencies. | |
| run: npm ci | |
| # Checkout the benchmark results repository | |
| - name: Checkout stats repository | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: folk-js/folk-canvas-stats | |
| path: folk-canvas-stats | |
| token: ${{ secrets.BENCHMARK_REPO_TOKEN }} | |
| # Run benchmarks with path to existing results | |
| - name: Run benchmarks | |
| run: npm run bench | |
| env: | |
| BENCHMARK_HISTORY_PATH: folk-canvas-stats/mitata_benchmarks.json | |
| # Commit and push updates if there are changes | |
| - name: Update benchmark results | |
| run: | | |
| cd folk-canvas-stats | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Pull latest changes before pushing | |
| git pull origin main | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| echo "Changes detected in benchmark results" | |
| git add mitata_benchmarks.json | |
| git commit -m "Update benchmark results for ${{ github.sha }}" | |
| git push | |
| else | |
| echo "No changes in benchmark results" | |
| fi |