-
Notifications
You must be signed in to change notification settings - Fork 33
205 lines (184 loc) · 7.05 KB
/
isolated.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Tests for Breadboard in an isolated environment
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
BOARD: dl_board.json
jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Checkout CI fixtures
user: actions/checkout@mail
with:
sparse-checkout: .github/fixtures
- name: Read .github/fixtures/npx_scripts.json
id: matrix
run: |
JSON_CONTENT=$(cat .github/fixtures/npx_scripts.json)
echo $JSON_CONTENT
echo "matrix=$(echo $JSON_CONTENT | jq -r '.commands[] | "name=\(.name) script=\(.script)"')" > $GITHUB_ENV
test-current-release:
needs: setup
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup.outputs.matrix)}}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@main
with:
node-version: "21.x"
- name: ${{ matrix.name }}
run:
${{ matrix.script }}
publish:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@main
with:
node-version: "20.x"
registry-url: "https://npm.pkg.github.com/"
cache: "npm"
- uses: actions/github-script@main
with:
script: |
const fn = require('${{ github.workspace }}/.github/scripts/dist/index.js')
await fn()
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test:
needs: publish
permissions:
contents: read
packages: read
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- 21.x
# - 20.x
# - 19.x
# - 18.x
npm-version:
- 10.x
# - 9.x
# - 8.x
# - 7.x
# - 6.x
exclude:
- node-version: 19.x
npm-version: 9.x
- node-version: 19.x
npm-version: 10.x
commands:
- name: npx cli run
script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npx @$OWNER_LC/breadboard-cli --version
npx @$OWNER_LC/breadboard-cli run $BOARD -i "{\"message\": \"Hello World\"}"
- name: install + npx cli run
script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npm install -g @$OWNER_LC/breadboard-cli
npx @$OWNER_LC/breadboard-cli --version
npx @$OWNER_LC/breadboard-cli run $BOARD -i "{\"message\": \"Hello World\"}"
- name: install x2 + npx cli run
script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npm install -g @$OWNER_LC/breadboard @$OWNER_LC/breadboard-cli
npx @$OWNER_LC/breadboard-cli --version
npx @$OWNER_LC/breadboard-cli run $BOARD -i "{\"message\": \"Hello World\"}"
- name: install + npx breadboard run
script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npx @$OWNER_LC/breadboard-cli --version
npm install -g @$OWNER_LC/breadboard-cli
npx breadboard run $BOARD -i "{\"message\": \"Hello World\"}"
##############################################################################################################
- name: npx cli mermaid
script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npx @$OWNER_LC/breadboard-cli --version
npx @$OWNER_LC/breadboard-cli mermaid dl_board.json
- name: install + npx cli mermaid
script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npm install -g @$OWNER_LC/breadboard-cli
npx @$OWNER_LC/breadboard-cli --version
npx @$OWNER_LC/breadboard-cli mermaid dl_board.json
- name: install x2 + npx cli mermaid
script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npm install -g @$OWNER_LC/breadboard @$OWNER_LC/breadboard-cli
npx @$OWNER_LC/breadboard-cli --version
npx @$OWNER_LC/breadboard-cli mermaid dl_board.json
- name: install + npx breadboard mermaid
script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npx @$OWNER_LC/breadboard-cli --version
npm install -g @$OWNER_LC/breadboard-cli
npx breadboard mermaid dl_board.json
# ##############################################################################################################
- script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npx @$OWNER_LC/create-breadboard --version
npm init @$OWNER_LC/breadboard test
name: npm init
- script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npx @$OWNER_LC/create-breadboard --version
npx @$OWNER_LC/create-breadboard test
name: npx create
- script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npx @$OWNER_LC/create-breadboard --version
npm install -g @$OWNER_LC/create-breadboard
npx @$OWNER_LC/create-breadboard test
name: install + npx create
##############################################################################################################
- script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npx @$OWNER_LC/create-breadboard-kit --version
npm init @$OWNER_LC/breadboard-kit test
name: npm init kit
- script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npx @$OWNER_LC/create-breadboard-kit --version
npx @$OWNER_LC/create-breadboard-kit test
name: npx create-kit
- script: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
npx @$OWNER_LC/create-breadboard-kit --version
npm install -g @$OWNER_LC/create-breadboard-kit
npx @$OWNER_LC/create-breadboard-kit test
name: install + npx create-kit
name: ${{ matrix.commands.name }} - Node ${{ matrix.node-version }} NPM ${{ matrix.npm-version }}
steps:
- run: set -ev
- run: echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: "${{ github.repository_owner }}"
- uses: actions/setup-node@main
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://npm.pkg.github.com/"
scope: $OWNER_LC
- run: npm install -g npm@${{ matrix.npm-version }}
- run: wget https://raw.githubusercontent.com/ExaDev-io/breadboard-samples/develop/samples/Breadboard%20Walkthrough/src/hello-world/board.json -O $BOARD
- run: npm config set -g @$OWNER_LC:registry https://npm.pkg.github.com/
- name: Run command
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -ev
${{ matrix.commands.script }}