-
Notifications
You must be signed in to change notification settings - Fork 1.7k
168 lines (146 loc) · 5.35 KB
/
ci-core-partial.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
name: Core Unit Tests
# Run on key branches to make sure integration is good, otherwise run on all PR's
on:
push:
branches:
- develop
- main
- "release/*"
merge_group:
pull_request:
jobs:
run-unit-tests:
name: Tests (${{ matrix.type.test-suite }})
runs-on: ubuntu22.04-32cores-128GB
permissions:
id-token: write
contents: write
strategy:
fail-fast: false
matrix:
type:
- test-suite: "core"
module-directory: "./"
build-flags: "-tags=integration"
- test-suite: "ccip-deployment"
tag-filter: ""
module-directory: "./deployment"
env:
# We explicitly have this env var not be "CL_DATABASE_URL" to avoid having it be used by core related tests
# when they should not be using it, while still allowing us to DRY up the setup
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
steps:
- name: Checkout the repo
uses: actions/[email protected]
- name: Setup CI Core Environment
uses: ./.github/actions/setup-ci-core-tests
with:
test-suite: ${{ matrix.type.cmd }}
db-url: ${{ env.DB_URL }}
- name: Build Tests
uses: smartcontractkit/.github/apps/go-test-caching@feat/go-test-binary-comparison
with:
pipeline-step: "build"
build-concurrency: "32"
test-suite: ${{ matrix.type.test-suite }}
module-directory: ${{ matrix.type.module-directory }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Tests
uses: smartcontractkit/.github/apps/go-test-caching@feat/go-test-binary-comparison
env:
CL_DATABASE_URL: ${{ env.DB_URL }}
with:
pipeline-step: "run"
run-all-tests: "true"
run-concurrency: "16"
test-suite: ${{ matrix.type.test-suite }}
module-directory: ${{ matrix.type.module-directory }}
tag-filter: ${{ matrix.type.tag-filter }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Update Test Index
uses: smartcontractkit/.github/apps/go-test-caching@feat/go-test-binary-comparison
with:
pipeline-step: "update"
force-update-index: "true"
test-suite: ${{ matrix.type.test-suite }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Print postgres logs
if: ${{ always() }}
run: docker compose logs postgres | tee ../../../postgres_logs.txt
working-directory: ./.github/actions/setup-postgres
run-fuzz-tests:
name: Tests (fuzz)
if: ${{ github.ref == 'refs/heads/dont-run' }}
runs-on: ubuntu22.04-32cores-128GB
env:
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
steps:
- name: Checkout the repo
uses: actions/[email protected]
- name: Change Modtime of Files (cache optimization)
shell: bash
run: |
find . -type f,d -exec touch -r {} -d '1970-01-01T00:00:01' {} \; || true
- name: Setup CI Core Environment
uses: ./.github/actions/setup-ci-core-tests
with:
test-suite: "fuzz"
db-url: ${{ env.DB_URL }}
- name: Increase Timeouts
if: ${{ github.event.schedule != ''}}
run: |
echo "FUZZ_TIMEOUT_MINUTES=10">> $GITHUB_ENV
- name: Run Fuzz Tests
env:
OUTPUT_FILE: ./output.txt
CL_DATABASE_URL: ${{ env.DB_URL }}
run: ./tools/bin/go_core_fuzz ./...
- name: Print postgres logs
if: ${{ always() }}
run: docker compose logs postgres | tee ../../../postgres_logs.txt
working-directory: ./.github/actions/setup-postgres
run-race-tests:
name: Tests (race)
if: ${{ github.ref == 'refs/heads/dont-run' }}
runs-on: ubuntu22.04-32cores-128GB
env:
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
steps:
- name: Checkout the repo
uses: actions/[email protected]
- name: Change Modtime of Files (cache optimization)
shell: bash
run: |
find . -type f,d -exec touch -r {} -d '1970-01-01T00:00:01' {} \; || true
- name: Setup CI Core Environment
uses: ./.github/actions/setup-ci-core-tests
with:
test-suite: "race"
db-url: ${{ env.DB_URL }}
- name: Increase Timeouts
if: ${{ github.event.schedule != ''}}
run: |
echo "TIMEOUT=10m" >> $GITHUB_ENV
echo "COUNT=50" >> $GITHUB_ENV
- name: Run Race Tests
env:
OUTPUT_FILE: ./output.txt
CL_DATABASE_URL: ${{ env.DB_URL }}
run: ./tools/bin/go_core_race_tests ./...
- name: Print Races
id: print-races
if: ${{ failure() }}
run: |
find race.* | xargs cat > race.txt
if [[ -s race.txt ]]; then
cat race.txt
echo "post_to_slack=true" >> $GITHUB_OUTPUT
else
echo "post_to_slack=false" >> $GITHUB_OUTPUT
fi
echo "github.event_name: ${{ github.event_name }}"
echo "github.ref: ${{ github.ref }}"
- name: Print postgres logs
if: ${{ always() }}
run: docker compose logs postgres | tee ../../../postgres_logs.txt
working-directory: ./.github/actions/setup-postgres