-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (44 loc) · 1.23 KB
/
ci.yml
File metadata and controls
48 lines (44 loc) · 1.23 KB
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
name: CI
env:
CI: true
on:
push:
branches: "*"
pull_request:
branches: "*"
jobs:
find-workspaces:
runs-on: ubuntu-latest
outputs:
list: ${{ steps.write-output.outputs.list }}
workspaces: ${{ steps.write-output.outputs.workspaces }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Write output
id: write-output
run: |
WORKSPACES=$(ls examples | tr '\n' ',' | sed 's/,$//;s/\([^,]*\)/"\1"/g')
LIST="[$(echo ${WORKSPACES// /\", \"})]"
echo "List: $LIST"
echo "list=$LIST" >> "$GITHUB_OUTPUT"
echo "workspaces={\"workspace\":$LIST}" >> "$GITHUB_OUTPUT"
test:
runs-on: ubuntu-latest
needs: find-workspaces
if: needs.find-workspaces.outputs.list != '[""]'
strategy:
matrix: ${{fromJson(needs.find-workspaces.outputs.workspaces)}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
shell: bash
run: yarn --frozen-lockfile
- name: Test ${{ matrix.workdir }}
run: |
set -euo pipefail
yarn workspace @mimicprotocol/${{ matrix.workspace }} test
code=$?
echo "exit code: $code"
exit $code