Build Runtimes #1160
This file contains 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: Build Runtimes | |
on: | |
push: | |
branches: [main] | |
paths: | |
- 'runtimes/bun-script/**' | |
- 'runtimes/deno-cdn-script/**' | |
- 'runtimes/deno-cdn-script/**' | |
- 'runtimes/node-cjs-script/**' | |
- 'runtimes/node-esm-script/**' | |
workflow_dispatch: | |
schedule: | |
- cron: '30 1 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
bun: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# Bun can specify "--platform": browser | node | bun | |
# https://github.com/oven-sh/bun#buntranspiler | |
# platform: [browser, node, bun] | |
test: [bun-script] | |
#bun-version: [0.1.x, '*'] | |
bun-version: [latest, canary] | |
defaults: | |
run: | |
working-directory: runtimes/${{ matrix.test }} | |
name: Bun ${{ matrix.bun-version }} ${{ matrix.test }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@123c6c4e2fea3eb7bffaa91a85eb6b3d505bf7af # v2 | |
with: | |
bun-version: ${{ matrix.node-version }} | |
- run: bun install | |
- run: bun run test:expected | |
- run: bun run test:actual | |
timeout-minutes: 1 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.test }}-${{ matrix.bun-version }} | |
path: runtimes/${{ matrix.test }}/artifacts/*.json | |
if-no-files-found: error | |
retention-days: 1 | |
- run: git status | |
deno: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
test: [deno-cdn-script, deno-npm-script] | |
defaults: | |
run: | |
working-directory: runtimes/${{ matrix.test }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- uses: denoland/setup-deno@v1 | |
with: | |
deno-version: vx.x.x | |
- run: deno task test | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.test }} | |
path: runtimes/${{ matrix.test }}/artifacts/*.json | |
if-no-files-found: error | |
retention-days: 1 | |
node: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
test: [node-cjs-script, node-esm-script] | |
node-version: [lts/-3, lts/-2, lts/-1, lts/*, current] | |
defaults: | |
run: | |
working-directory: runtimes/${{ matrix.test }} | |
name: Node.js ${{ matrix.node-version }} ${{ matrix.test }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: npm | |
check-latest: true | |
node-version: ${{ matrix.node-version }} | |
- run: npm install | |
- run: npx tsc | |
if: matrix.node-version == 'lts/*' | |
- run: npm test | |
- name: Get Node.js major version | |
uses: mathiasvr/command-output@8dbf451add3db114df0114aa5e21a1efef8c5015 # tag=v1 | |
id: version | |
with: | |
run: node -e "console.log(process.version.split('.')[0])" | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.test }}-${{ steps.version.outputs.stdout }} | |
path: runtimes/${{ matrix.test }}/artifacts/*.json | |
if-no-files-found: error | |
retention-days: 1 | |
- run: git status | |
artifacts: | |
runs-on: ubuntu-latest | |
needs: [bun, deno, node] | |
name: Commit artifacts to dashboard/public | |
if: always() | |
# if: github.ref_name == 'main' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
cache: npm | |
node-version: lts/* | |
- run: npm install | |
- uses: actions/download-artifact@v3 | |
id: download | |
with: | |
path: dashboard/public/outputs | |
- name: 'Dump download outputs' | |
run: echo '${{ toJSON(steps.download.outputs) }}' | |
- run: ls -R ${{steps.download.outputs.download-path}} | |
- run: git status | |
- run: npx prettier --ignore-path .gitignore --write dashboard/public/outputs | |
- run: git status | |
- uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9 | |
if: always() | |
with: | |
commit: --no-verify | |
message: 'chore(artifacts): update outputs' | |
default_author: github_actions | |
pull: '--rebase --autostash' |