-
Notifications
You must be signed in to change notification settings - Fork 239
187 lines (160 loc) · 6.36 KB
/
ci.feature.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
name: CI | Feature Branches
on:
# TODO We no longer do these, instead you always need to create a pull request
# Triggered by internal pushes
# push:
# branches-ignore: ["dev", "release-*"]
#
# NOTE To continue the old behaviour, these code snipeets is needed in the check job
## triggered by internal pushes or external PRs
## if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'superfluid-finance/protocol-monorepo'
merge_group:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Checking what packages need to be built
runs-on: ubuntu-latest
defaults:
run:
shell: nix develop .#ci-minimum -c bash -xe {0}
outputs:
build_solidity_semantic_money: ${{ env.BUILD_SOLIDITY_SEMANTIC_MONEY }}
build_ethereum_contracts: ${{ env.BUILD_ETHEREUM_CONTRACTS }}
build_hot_fuzz: ${{ env.BUILD_HOT_FUZZ }}
build_subgraph: ${{ env.BUILD_SUBGRAPH }}
build_sdk_core: ${{ env.BUILD_SDK_CORE }}
build_spec_haskell: ${{ env.BUILD_SPEC_HASKELL }}
build_automation_contracts: ${{ env.BUILD_AUTOMATION_CONTRACTS }}
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v13
- name: Initialize nix dev shell
run: |
node --version
yarn --version
shellcheck --version
actionlint --version
- name: Show contexts
env:
HEAD_REF: ${{ github.head_ref }}
GITHUB_REF: ${{ github.ref }}
run: |
echo github.event_name: ${{ github.event_name }}
echo github.sha: ${{ github.sha }}
echo github.repository: ${{ github.repository }}
echo github.ref: "$GITHUB_REF"
echo github.head_ref: "$HEAD_REF"
echo github.base_ref: ${{ github.base_ref }}
- name: Run global lint
run: |
npm run lint:shellcheck
npm run lint:actionlint
- name: Create build set
run: tasks/create-build-set.sh ${{ github.sha }} dev origin
test-spec-haskell:
name: Test Spec Haskell (Feature Branch)
uses: ./.github/workflows/call.test-spec-haskell.yml
needs: [check]
if: needs.check.outputs.build_spec_haskell
test-solidity-semantic-money:
name: Test Solidity Semantic Money Library (Feature Branch)
uses: ./.github/workflows/call.test-solidity-semantic-money.yml
needs: [ check ]
if: needs.check.outputs.build_solidity_semantic_money
test-ethereum-contracts:
name: Test ethereum-contracts (Feature Branch)
uses: ./.github/workflows/call.test-ethereum-contracts.yml
needs: [check]
if: needs.check.outputs.build_ethereum_contracts
with:
run-coverage-tests: false
coverage-ethereum-contracts:
name: Coverage Test ethereum-contracts (Feature Branch)
uses: ./.github/workflows/call.test-ethereum-contracts.yml
needs: [check]
if: needs.check.outputs.build_ethereum_contracts
with:
run-coverage-tests: true
test-hot-fuzz:
name: Hot Fuzz Superfluid Protocol (Feature Branch)
uses: ./.github/workflows/call.test-hot-fuzz.yml
needs: [ check ]
if: needs.check.outputs.build_hot_fuzz
# sdk-core integration test + local subgraph w/ local sdk-core
test-sdk-core:
name: Test sdk-core (Feature Branch)
uses: ./.github/workflows/call.test-sdk-core.yml
needs: [check]
if: needs.check.outputs.build_sdk_core
with:
subgraph-release: local
subgraph-endpoint: http://localhost:8000/subgraphs/name/superfluid-test
run-coverage-tests: false
coverage-sdk-core:
name: Coverage Test sdk-core (Feature Branch)
uses: ./.github/workflows/call.test-sdk-core.yml
needs: [check]
if: needs.check.outputs.build_sdk_core
with:
subgraph-release: local
subgraph-endpoint: http://localhost:8000/subgraphs/name/superfluid-test
run-coverage-tests: true
test-subgraph:
name: Test Subgraph (Feature Branch)
uses: ./.github/workflows/call.test-local-subgraph.yml
needs: [check]
if: needs.check.outputs.build_subgraph
test-automation-contracts:
name: Test Automation Contracts (Feature Branch)
uses: ./.github/workflows/call.test-automation-contracts.yml
needs: [check]
if: needs.check.outputs.build_automation_contracts
upload-coverage-reports:
name: Upload Coverage Reports (Feature Branch)
uses: ./.github/workflows/call.upload-coverage-reports.yml
needs: [coverage-ethereum-contracts, coverage-sdk-core]
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
# Note:
#
# Since we have a poor man's incremental CI where packages that are not affected in the feature branche
# is not tested, it is important to distinguish jobs that were skipped versus jobs that were failed. And
# this aggregation job does just that.
all-packages-tested:
name: All packages tested (Feature Branch)
runs-on: ubuntu-latest
if: always()
needs: [ test-spec-haskell
, test-solidity-semantic-money
, test-ethereum-contracts, coverage-ethereum-contracts
, test-hot-fuzz
, test-sdk-core, coverage-sdk-core
, test-subgraph
, test-automation-contracts
]
steps:
- name: Test Results
run: |
function check_result() {
local package_name="$1"
local result="$2"
if [ "$result" == "skipped" ];then
echo "Skipped job: $package_name."
else
echo "Checking if the job \"$package_name\" passes..."
test "$result" == "success"
echo "Passed."
fi
}
check_result spec-haskell ${{ needs.test-spec-haskell.result }}
check_result solidity-semantic-money ${{ needs.test-solidity-semantic-money.result }}
check_result test-ethereum-contracts ${{ needs.test-ethereum-contracts.result }}
check_result coverage-ethereum-contracts ${{ needs.coverage-ethereum-contracts.result }}
check_result hot-fuzz ${{ needs.test-hot-fuzz.result }}
check_result test-sdk-core ${{ needs.test-sdk-core.result }}
check_result coverage-sdk-core ${{ needs.coverage-sdk-core.result }}
check_result subgraph ${{ needs.test-subgraph.result }}
check_result automation-contracts ${{ needs.test-automation-contracts.result }}