-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (133 loc) · 4.14 KB
/
runtimes.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
---
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'