-
-
Notifications
You must be signed in to change notification settings - Fork 46
50 lines (49 loc) · 1.36 KB
/
simunit.yaml
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
name: Unit Simulations
on:
workflow_dispatch:
pull_request:
repository_dispatch:
types: rebuild
push:
branches:
- master
schedule:
- cron: '0 0 * * *' # runs every night
jobs:
find_unit_sims:
runs-on: ubuntu-latest
outputs:
unitsims: ${{ steps.generate-matrix.outputs.unitsims }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
token: ${{secrets.PAT}} # Personal Access Token, must be defined in the repo's secrets
- id: generate-matrix
run: |
for folder in `find -name .simunit | xargs dirname`; do
if [ ! -z "$UNITSIMS" ]; then UNITSIMS="$UNITSIMS, "; fi
UNITSIMS="$UNITSIMS \"$folder\""
done
UNITSIMS="[ $UNITSIMS ]"
echo $UNITSIMS
echo "unitsims=${UNITSIMS}" >> $GITHUB_OUTPUT
run_sims:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
needs:
- find_unit_sims
strategy:
fail-fast: false
matrix:
unitsim: ${{ fromJSON(needs.find_unit_sims.outputs.unitsims) }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
token: ${{ secrets.PAT }}
- id: simulation
run: |
docker run --network host -v `pwd`:/jtcores jotego/linter /jtcores/modules/jtframe/devops/xsimunit.sh /jtcores/${{matrix.unitsim}}