add caching #135
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: Package Manager Benchmarks | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| setup: | |
| name: 'Setup' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache Bins | |
| uses: actions/cache@v4 | |
| with: | |
| path: bins | |
| key: bins | |
| - name: Install Node | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: '22' | |
| - name: Install & Setup Tools | |
| run: | | |
| bash ./scripts/setup.sh | |
| task: | |
| name: 'Benchmark Running Tasks' | |
| runs-on: ubuntu-latest | |
| needs: [setup] | |
| steps: | |
| - name: Restore Bins | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: bins | |
| key: bins | |
| - name: Run Task Execution Benchmarks | |
| run: | | |
| bash ./scripts/run.sh | |
| - name: Upload Benchmark Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: task-benchmark-results | |
| path: ./results/run.json | |
| next: | |
| name: 'Benchmark Next Project' | |
| runs-on: ubuntu-latest | |
| needs: [setup] | |
| steps: | |
| - name: Restore Bins | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: bins | |
| key: bins | |
| - name: Run Project Benchmarks | |
| run: | | |
| bash ./scripts/install.sh next | |
| - name: Upload Benchmark Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: next-benchmark-results | |
| path: ./results/next/ | |
| astro: | |
| name: 'Benchmark Astro Project' | |
| runs-on: ubuntu-latest | |
| needs: [setup] | |
| steps: | |
| - name: Restore Bins | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: bins | |
| key: bins | |
| - name: Run Project Benchmarks | |
| run: | | |
| bash ./scripts/install.sh astro | |
| - name: Upload Benchmark Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: astro-benchmark-results | |
| path: ./results/astro/ | |
| svelte: | |
| name: 'Benchmark Svelte Project' | |
| runs-on: ubuntu-latest | |
| needs: [setup] | |
| steps: | |
| - name: Restore Bins | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: bins | |
| key: bins | |
| - name: Run Project Benchmarks | |
| run: | | |
| bash ./scripts/install.sh svelte | |
| - name: Upload Benchmark Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: svelete-benchmark-results | |
| path: ./results/svelte/ | |
| vue: | |
| name: 'Benchmark Vue Project' | |
| runs-on: ubuntu-latest | |
| needs: [setup] | |
| steps: | |
| - name: Restore Bins | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: bins | |
| key: bins | |
| - name: Run Project Benchmarks (Vue) | |
| run: | | |
| bash ./scripts/install.sh vue | |
| - name: Upload Benchmark Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vue-benchmark-results | |
| path: ./results/vue/ | |
| # make a chart with the results | |
| chart: | |
| name: 'Chart the Benchmark Results' | |
| runs-on: ubuntu-latest | |
| needs: [task, next, astro, svelte, vue] | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: results | |
| merge-multiple: true | |
| - name: List the results | |
| run: ls -R results |