Skip to content

Commit 03f0d7e

Browse files
Merge pull request #61 from SkylabsAI/paolo/ci-branches
CI simplification: simplify testing changes to our GitHub Actions
2 parents fc4a36c + 2c3d166 commit 03f0d7e

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

.github/actions/checkout_workspace/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "Checkout Workspace Directory"
2-
description: ""
2+
description: "Can be invoked multiple times. Depends on `prepare_workspace`."
33

44
inputs:
55
CHECKOUT_BASE:

.github/actions/prepare_workspace/action.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "Prepare to Checkout Workspace Directory"
2-
description: ""
2+
description: "Invoked exactly once per job. Depends on 'Download CI files' step."
33

44
inputs:
55
FM_CI_TOKEN:
@@ -10,9 +10,7 @@ inputs:
1010
runs:
1111
using: "composite"
1212
steps:
13-
# TODO branches here are a problem
14-
- id: initialize
15-
uses: SkylabsAI/workspace/.github/actions/initialize_workspace@main
13+
- uses: ./actions/initialize_workspace
1614
with:
1715
FM_CI_TOKEN: ${{ inputs.FM_CI_TOKEN }}
1816
- uses: actions/download-artifact@v5

.github/workflows/main.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ env:
2323
DUNE_PROFILE: "br_timing"
2424
UV_LINK_MODE: "copy"
2525
ROCQ_LOG_PREFIX: bluerock
26-
OPAM_PACKAGES: opam pin | grep -E -v "(/bluerock|rocq-test-suite|br_auto_tests_brick_pm)"
26+
OPAM_PACKAGES: opam pin | grep /fmdeps/ | grep -v rocq-test-suite
2727

2828
jobs:
29+
2930
gen-job:
31+
name: "Choose commits to compare"
3032
runs-on:
3133
group: FM
3234
container:
@@ -44,6 +46,7 @@ jobs:
4446
- name: "Checkout workspace (from workspace)"
4547
if: github.repository == 'SkylabsAI/workspace'
4648
uses: actions/checkout@v5
49+
# Use local version if changing workspace, otherwise checkout from main
4750
- name: "Initialize workspace (from workspace)"
4851
if: github.repository == 'SkylabsAI/workspace'
4952
uses: ./.github/actions/initialize_workspace
@@ -64,12 +67,16 @@ jobs:
6467
uses: actions/upload-artifact@v4
6568
with:
6669
name: ${{ env.CI_FILES_ARTIFACT }}
70+
# Caveat: this strips the common prefix `workspace_checkout/.github` from file paths.
6771
path: |
6872
workspace_checkout/.github/actions/*
6973
workspace_checkout/.github/workflows/*
7074
7175
76+
# MR merging can require this check to succeed, to depend on all of CI.
77+
# MAINTENANCE NOTE: Must depend on all "actual" jobs
7278
workspace-success:
79+
name: "Check if CI succeeded"
7380
needs: [opam-build, full-build, python-build]
7481
if: always()
7582
runs-on: ubuntu-latest
@@ -84,7 +91,8 @@ jobs:
8491
echo "Checking that python-build succeeded"
8592
${{ needs.python-build.result == 'success' && 'true' || 'false' }}
8693
87-
94+
# Regular jobs [should] follow the template of `opam-build` up to
95+
# `checkout_workspace`, and then add their payload.
8896
opam-build:
8997
needs: gen-job
9098
defaults:
@@ -97,6 +105,7 @@ jobs:
97105
image: "ghcr.io/skylabsai/workspace:fm-default"
98106
options: "-v /cache:/cache:ro -v /home/coq/.ssh:/home/coq/.ssh -v /home/coq/dune_nfs/dune_cache:/home/coq/.cache --security-opt seccomp=/home/coq/seccomp.json"
99107
steps:
108+
# Here and in other jobs, this is the inverse of "Upload actions and workflows", and it lets us find the correct actions under `./actions`.
100109
- name: "Download CI files"
101110
uses: actions/download-artifact@v5
102111
with:
@@ -228,6 +237,7 @@ jobs:
228237
uv --directory ${{ matrix.project-dir }} run task ${{ matrix.task }}
229238
230239
240+
# Unlike opam-build, this job invokes checkout_workspace twice not once.
231241
full-build:
232242
needs: gen-job
233243
defaults:
@@ -306,7 +316,7 @@ jobs:
306316
mkdir ${{ env.SCRATCHDIR }}/globs-job/
307317
find _build/ -type f -! -empty -name '*.glob.std*' > files_to_rsync
308318
rsync -a --prune-empty-dirs --files-from=files_to_rsync ./ ${{ env.SCRATCHDIR}}/globs-job/
309-
#
319+
#
310320
dune exec -- coqc-perf.extract-all _build/default perf-data
311321
dune exec -- hint-data.extract-all ${NJOBS} perf-data
312322
du -hs _build
@@ -357,7 +367,7 @@ jobs:
357367
mkdir ${{ env.SCRATCHDIR }}/globs-base/
358368
find _build/ -type f -! -empty -name '*.glob.std*' > files_to_rsync
359369
rsync -a --prune-empty-dirs --files-from=files_to_rsync ./ ${{ env.SCRATCHDIR}}/globs-base/
360-
#
370+
#
361371
dune exec -- coqc-perf.extract-all _build/default perf-data
362372
dune exec -- hint-data.extract-all ${NJOBS} perf-data
363373
du -hs _build

0 commit comments

Comments
 (0)