Repository navigation
173 lines (167 loc) · 6.66 KB
/
Copy pathminer-tests.yml
File metadata and controls
173 lines (167 loc) · 6.66 KB
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
name: Miner integration tests
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
on:
workflow_dispatch:
pull_request:
branches:
- main
types: [opened, synchronize, reopened, labeled, unlabeled]
schedule:
- cron: "0 13 * * *" # Runs every day at 13:00 UTC
env:
CI: 1
CACHE_TIMEOUT_MINUTES: 5
SCRIPT_TIMEOUT_MINUTES: 30
FIL_PROOFS_PARAMETER_CACHE: /var/tmp/filecoin-proof-parameters
SHELL_IMAGE: busybox
jobs:
# Pull requests only run the tests with the `Miner` or `Release` label.
build:
name: Build Forest
if: |-
${{ github.event_name != 'pull_request'
|| contains(github.event.pull_request.labels.*.name, 'Miner')
|| contains(github.event.pull_request.labels.*.name, 'Release') }}
runs-on: ubuntu-24.04
env:
RUSTC_WRAPPER: sccache
CC: sccache clang
CXX: sccache clang++
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
steps:
- name: Configure SCCache variables
run: |
# External PRs do not have access to 'vars' or 'secrets'.
if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then
{
echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}"
echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}"
echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}"
} >> "$GITHUB_ENV"
fi
- uses: rui314/setup-mold@339e96b4ff1f3bd865856ba4cbbe8818a7acb038 # v1
with:
make-default: false
- name: Checkout Sources
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup sccache
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version-file: "go.work"
cache-dependency-path: "**/go.sum"
- uses: jdx/mise-action@90f833d396d0cc3674b631d2d225e306476c303a # v5.2.10
- name: Install Forest
env:
# To minimize compile times: https://nnethercote.github.io/perf-book/build-configuration.html#minimizing-compile-times
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=mold"
run: mise run install --slim quick
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: "forest-${{ runner.os }}"
path: |
~/.cargo/bin/forest*
if-no-files-found: error
miner-tests:
name: Miner integration tests (${{ matrix.group }})
needs: build
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
# The `forest-dev devnet miner --group` values. Add groups as more Lotus itests are ported.
group: [onboarding, wdpost, worker-key]
include:
# The worker-key window takes about 1 h and opens 1 h after the proposal: pull requests
# stop at its start, scheduled and manual runs check all of it, about 2 h.
- group: worker-key
args: ${{ github.event_name != 'pull_request' && '--ignored' || '' }}
timeout: 240
env:
# We use a custom Dockerfile for CI to speed up the build process.
FOREST_DOCKERFILE_OVERRIDE: scripts/devnet/forest_ci.dockerfile
MINER_TEST_GROUP: ${{ matrix.group }}
MINER_TEST_ARGS: ${{ matrix.args }}
steps:
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
id: cache
with:
path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}"
key: proof-params-2k
- name: Load cache into volume
if: steps.cache.outputs.cache-hit == 'true'
run: |
docker volume create devnet-forest-miner_filecoin-proofs
docker run --rm \
-v devnet-forest-miner_filecoin-proofs:/proofs \
-v "$FIL_PROOFS_PARAMETER_CACHE":/cache \
"$SHELL_IMAGE" \
sh -c "cp /cache/* /proofs"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: "forest-${{ runner.os }}"
- name: Devnet setup
run: ./scripts/devnet-forest-miner/setup.sh
timeout-minutes: ${{ fromJSON(env.SCRIPT_TIMEOUT_MINUTES) }}
- name: Devnet check
run: ./scripts/devnet-forest-miner/check.sh
timeout-minutes: ${{ fromJSON(env.SCRIPT_TIMEOUT_MINUTES) }}
- name: Add forest binaries to PATH
run: |
chmod +x "$GITHUB_WORKSPACE"/forest*
echo "$GITHUB_WORKSPACE" >> "$GITHUB_PATH"
- name: Miner tests
run: |
set -euo pipefail
export DEVNET_DIR=scripts/devnet-forest-miner
source ./scripts/devnet/test_harness.sh
devnet_test_env_init
forest-dev devnet miner --group "$MINER_TEST_GROUP" ${MINER_TEST_ARGS:+"$MINER_TEST_ARGS"}
timeout-minutes: ${{ matrix.timeout || 120 }}
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@2741064ab9d7af54b0b1ffb6076cf64c16f0220e # v2.2.2
- name: Prepare cache folder for uploading
if: steps.cache.outputs.cache-hit != 'true'
run: |
docker run --rm \
-v devnet-forest-miner_filecoin-proofs:/proofs \
-v "$FIL_PROOFS_PARAMETER_CACHE":/cache \
"$SHELL_IMAGE" \
sh -c "cp /proofs/* /cache"
sudo chmod -R 755 "$FIL_PROOFS_PARAMETER_CACHE"
# One issue per failed scheduled run, including a failed build.
report-failure:
name: Report failure
permissions:
contents: read
issues: write
needs: [build, miner-tests]
if: ${{ failure() && github.event_name == 'schedule' }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set WORKFLOW_URL
run: |
export WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
echo "${WORKFLOW_URL}"
echo "WORKFLOW_URL=${WORKFLOW_URL}" >> "$GITHUB_ENV"
- uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/MINER_TESTS_ISSUE_TEMPLATE.md