-
Notifications
You must be signed in to change notification settings - Fork 108
91 lines (81 loc) · 3.14 KB
/
sim.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
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
name: sim
on:
push:
branches:
- develop
pull_request:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
inputs:
make-targets:
description: 'Comma separated list of make targets to run (e.g., test-sim-nondeterminism, test-sim-fullappsimulation)'
required: true
default: 'test-sim-nondeterminism'
concurrency:
group: simulation-${{ github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
matrix-conditionals:
runs-on: ubuntu-22.04
outputs:
SIM_TEST_NOND: ${{ steps.matrix-conditionals.outputs.SIM_TEST_NOND }}
SIM_TEST_FULL: ${{ steps.matrix-conditionals.outputs.SIM_TEST_FULL }}
SIM_TEST_IMPORT_EXPORT: ${{ steps.matrix-conditionals.outputs.SIM_TEST_IMPORT_EXPORT }}
SIM_TEST_AFTER_IMPORT: ${{ steps.matrix-conditionals.outputs.SIM_TEST_AFTER_IMPORT }}
steps:
- id: matrix-conditionals
uses: actions/github-script@v7
with:
script: |
const makeTargetsInput = context.payload.inputs ? context.payload.inputs['make-targets'] : null;
const defaultTargets = ['test-sim-nondeterminism', 'test-sim-fullappsimulation', 'test-sim-import-export', 'test-sim-after-import'];
const makeTargets = makeTargetsInput ? makeTargetsInput.split(',') : defaultTargets;
core.setOutput('SIM_TEST_NOND', makeTargets.includes('test-sim-nondeterminism'));
core.setOutput('SIM_TEST_FULL', makeTargets.includes('test-sim-fullappsimulation'));
core.setOutput('SIM_TEST_IMPORT_EXPORT', makeTargets.includes('test-sim-import-export'));
core.setOutput('SIM_TEST_AFTER_IMPORT', makeTargets.includes('test-sim-after-import'));
simulation-tests:
needs: matrix-conditionals
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- make-target: "test-sim-nondeterminism"
condition: ${{ needs.matrix-conditionals.outputs.SIM_TEST_NOND == 'true' }}
- make-target: "test-sim-fullappsimulation"
condition: ${{ needs.matrix-conditionals.outputs.SIM_TEST_FULL == 'true' }}
- make-target: "test-sim-import-export"
condition: ${{ needs.matrix-conditionals.outputs.SIM_TEST_IMPORT_EXPORT == 'true' }}
- make-target: "test-sim-after-import"
condition: ${{ needs.matrix-conditionals.outputs.SIM_TEST_AFTER_IMPORT == 'true' }}
name: ${{ matrix.make-target }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Install dependencies
run: make runsim
- name: Run ${{ matrix.make-target }}
if: ${{ matrix.condition }}
run: |
make ${{ matrix.make-target }}
sim-ok:
runs-on: ubuntu-22.04
needs:
- matrix-conditionals
- simulation-tests
if: always()
steps:
- name: Aggregate Results
run: |
result="${{ needs.simulation-tests.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi