-
Notifications
You must be signed in to change notification settings - Fork 12
49 lines (45 loc) · 1.46 KB
/
cadence.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
name: Run Cadence tests
on: pull_request
jobs:
get-recipe-repos:
runs-on: macos-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Dynamically retrieve matrix
id: set-matrix
run: echo "::set-output name=matrix::$(ls src/data/recipes/* | jq -R -s -c 'split("\n")[:-1]' )"
run-cadence-tests:
needs: get-recipe-repos
runs-on: macos-latest
strategy:
matrix:
recipe: ${{ fromJson(needs.get-recipe-repos.outputs.matrix) }}
steps:
- name: Set env
env:
RECIPE_REPO: "${{ matrix.recipe }}"
run: |
RECIPE_REPO=${{ env.RECIPE_REPO }}
RECIPE_REPO=${RECIPE_REPO//:} # replace all colons
echo RECIPE_REPO=${RECIPE_REPO} >> $GITHUB_ENV # update GitHub ENV vars
- name: print env
run: echo ${{ env.RECIPE_REPO }}
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install Flow CLI
run: |
if test -f ${{ env.RECIPE_REPO }}/cadence/tests.cdc; then
brew update
brew install flow-cli
flow init
fi
- name: Trigger recipe test
run: |
if test -f ${{ env.RECIPE_REPO }}/cadence/tests.cdc; then
flow test ${{ env.RECIPE_REPO }}/cadence/tests.cdc
fi