Skip to content

Commit 1362a52

Browse files
committed
feat: overhaul CI into reusable workflow with nightly and PR triggers
1 parent b9b958d commit 1362a52

3 files changed

Lines changed: 313 additions & 59 deletions

File tree

.github/workflows/ci_nightly.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
# Runs on a nightly schedule (and optionally via manual dispatch).
3+
#
4+
# Executes the full CI matrix: stability (latest tags) and frontier
5+
# (latest branches). Both runs file GitHub issues with their results
6+
# unless manually suppressed via workflow_dispatch inputs.
7+
8+
name: CI (Nightly)
9+
10+
on:
11+
schedule:
12+
# Nightly at 03:00 UTC
13+
- cron: '0 3 * * *'
14+
workflow_dispatch:
15+
inputs:
16+
reporting:
17+
description: 'Create GitHub issue with scenario report'
18+
type: boolean
19+
default: false
20+
skip_report_on_pass:
21+
description: 'Skip filing issue when all scenarios pass'
22+
type: boolean
23+
default: true
24+
25+
jobs:
26+
foc-devnet-test:
27+
strategy:
28+
fail-fast: false
29+
max-parallel: 1
30+
matrix:
31+
include:
32+
- name: stability
33+
init_flags: "--curio latesttag:pdpv0 --filecoin-services latesttag:main"
34+
issue_label: scenarios-run-stability
35+
issue_title: "FOC Devnet scenarios run report (stability)"
36+
- name: frontier
37+
init_flags: "--curio gitbranch:pdpv0 --filecoin-services gitbranch:main"
38+
issue_label: scenarios-run-frontier
39+
issue_title: "FOC Devnet scenarios run report (frontier)"
40+
uses: ./.github/workflows/ci_run.yml
41+
with:
42+
name: ${{ matrix.name }}
43+
init_flags: ${{ matrix.init_flags }}
44+
# Reporting is always on for scheduled runs; for manual dispatch it follows the input.
45+
enable_reporting: ${{ github.event_name == 'schedule' || inputs.reporting == true }}
46+
# On scheduled runs, such as nightly `inputs.skip_report_on_pass` is absent (empty string), so we cannot rely
47+
# on it directly. The LHS of || short-circuits to true for any non-dispatch trigger, giving
48+
# the desired default (skip on pass). For workflow_dispatch the LHS is false, so the user's
49+
# choice in inputs.skip_report_on_pass takes effect.
50+
skip_report_on_pass: ${{ github.event_name != 'workflow_dispatch' || inputs.skip_report_on_pass }}
51+
issue_label: ${{ matrix.issue_label }}
52+
issue_title: ${{ matrix.issue_title }}
53+
secrets: inherit
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
# Runs on every pull request targeting main, and on every merge to main.
3+
#
4+
# Executes lint checks, cargo tests, and a single CI run with the default
5+
# config (no special init_flags). Issue reporting is disabled — that is
6+
# reserved for the nightly schedule run.
7+
8+
name: CI (Pull Request)
9+
10+
on:
11+
pull_request:
12+
branches: ['main']
13+
push:
14+
branches: ['main']
15+
16+
jobs:
17+
lint:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 10
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Setup Rust toolchain
25+
uses: actions-rust-lang/setup-rust-toolchain@v1
26+
with:
27+
components: rustfmt, clippy
28+
29+
- name: Setup Python tools
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y pipx
33+
pipx install black
34+
echo "$HOME/.local/bin" >> $GITHUB_PATH
35+
36+
- name: Run linting (check mode)
37+
run: FIX=0 ./scripts/lint.sh
38+
39+
cargo-test:
40+
runs-on: ubuntu-latest
41+
timeout-minutes: 10
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Setup Rust toolchain
47+
uses: actions-rust-lang/setup-rust-toolchain@v1
48+
49+
- name: Install build dependencies
50+
run: |
51+
sudo apt-get update
52+
sudo apt-get install -y pkg-config libssl-dev
53+
54+
- name: Run tests
55+
run: cargo test --all-targets --all-features
56+
57+
foc-devnet-test:
58+
needs: [lint, cargo-test]
59+
uses: ./.github/workflows/ci_run.yml
60+
with:
61+
name: default
62+
init_flags: ''
63+
enable_reporting: false
64+
secrets: inherit

0 commit comments

Comments
 (0)