Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce new reusable workflow jobs and cleanup manual trigger #1954

Merged
merged 84 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
cfb141f
New reusable workflow for linting
jleibs Apr 20, 2023
817419c
Reusable workflow to build/test wheels
jleibs Apr 20, 2023
e0a65d3
Get rid of windows error with an extra gate
jleibs Apr 20, 2023
9a9a3fb
Upload/download artifact
jleibs Apr 20, 2023
f5e9a00
Remove deprecated ::set-output
jleibs Apr 20, 2023
35f269b
more linting
jleibs Apr 20, 2023
8bca6ed
Trying to debug EXPECTED_VERSION
jleibs Apr 20, 2023
6868331
Fixing github output
jleibs Apr 20, 2023
55acf6d
Replace cargo-deny matrix with a script
jleibs Apr 20, 2023
83cf5db
Share cache key between build-and-test / linting
jleibs Apr 20, 2023
bbae14b
Actually checkout code when running tests
jleibs Apr 20, 2023
3a00fee
Switch to sccache
jleibs Apr 21, 2023
1ab9d3c
Remove --deny warnings for rustflags
jleibs Apr 21, 2023
601ae97
New workflow for packaging and uploading
jleibs Apr 21, 2023
ce5c50f
Update manual dispatch to pass EXPECTED_VERSION
jleibs Apr 21, 2023
56eeac0
Remove PLATFORM from package since it's part of matrix
jleibs Apr 21, 2023
b757365
Plumb through BUILD flags
jleibs Apr 21, 2023
77e6a60
two-stage matrix
jleibs Apr 21, 2023
f4f2faf
Was missing pytest from non-linux builds
jleibs Apr 21, 2023
bae4490
Refactor matrix as several build jobs again
jleibs Apr 21, 2023
a784b8a
Pass through platform on packaging jobs
jleibs Apr 21, 2023
ac7dcbe
Always patch for prerelease if it's not a release
jleibs Apr 21, 2023
40e4a45
Push wheels to gcloud
jleibs Apr 21, 2023
fa4d248
Add job for running benchmarks
jleibs Apr 21, 2023
f818f09
Inherit secrets
jleibs Apr 21, 2023
a1aad07
Add missing permissions
jleibs Apr 21, 2023
470ec17
Include steps to upload docs
jleibs Apr 21, 2023
a0db139
Lighter bar for separation
jleibs Apr 21, 2023
ef40c45
Remove multi-line if
jleibs Apr 21, 2023
ef5b989
jobs for building and uploading to web
jleibs Apr 21, 2023
bc88d69
Lints is doing a lot more than linting
jleibs Apr 21, 2023
cac23df
Use the right scripts
jleibs Apr 21, 2023
2efe347
Fix input param for build web
jleibs Apr 21, 2023
1891567
More renaming lints -> checks
jleibs Apr 21, 2023
6114558
More naming
jleibs Apr 21, 2023
03b9853
More name cleanup
jleibs Apr 21, 2023
4213c8f
Introduce new faster job for e2e tests to use in CI
jleibs Apr 22, 2023
4f8e4b7
Refactor args to stay under 10
jleibs Apr 22, 2023
934ea00
Can't use develop in our environment so use build / pip install
jleibs Apr 22, 2023
6f2b0bb
Use the same build-and-test-wheels for the fast job
jleibs Apr 22, 2023
8fdf39f
More parameterization
jleibs Apr 22, 2023
e1f17cc
Rename maturin arg
jleibs Apr 22, 2023
0c5f9fd
Still enable extension-module feature
jleibs Apr 22, 2023
72ef833
Default wheel platforms to none
jleibs Apr 22, 2023
bb28327
Fix typo in web artifact
jleibs Apr 22, 2023
a9b69d9
Rename packages -> builds
jleibs Apr 22, 2023
90421a6
New plumbing for PR summary page
jleibs Apr 22, 2023
833277a
Fix PR template
jleibs Apr 22, 2023
a20b408
Add uploaded wheel to PR summary
jleibs Apr 22, 2023
8389afd
PR job needs permissions
jleibs Apr 22, 2023
ec4e5bb
Move the jinja inocation to a script that calls j2
jleibs Apr 22, 2023
0210121
Set up gcloud APIs
jleibs Apr 22, 2023
d1e5b71
Forgot to auth so we can upload the results
jleibs Apr 22, 2023
295c34e
Fix the PR summary script
jleibs Apr 22, 2023
688add5
new job to just build the wheels for a PR
jleibs Apr 22, 2023
10b1663
Use correct output path
jleibs Apr 22, 2023
2295e3d
Fix RUN_TESTS check now that the build and test happen in one step
jleibs Apr 22, 2023
579f8c2
Migrate the summary script to python
jleibs Apr 22, 2023
4675c9f
Lints
jleibs Apr 22, 2023
118d861
Python script needs the github token
jleibs Apr 22, 2023
5915a9a
More NOLINT for PyGithub
jleibs Apr 22, 2023
a4baa72
Add new mechanism to override the upload commit
jleibs Apr 22, 2023
c97b9af
Don't gate wheel-upload on running the tests since we can't run tests…
jleibs Apr 22, 2023
4bf9ded
Split out the deploy docs workflow
jleibs Apr 24, 2023
009482e
Comment and dep cleanup
jleibs Apr 24, 2023
0404db9
Clarify RELEASE_VERSION
jleibs Apr 24, 2023
2b332b7
The version check now happens between RELEASE_VERSION rather than GIT…
jleibs Apr 24, 2023
492bf5d
Upload wheels no longer needs the expected value
jleibs Apr 24, 2023
52e60c5
More sane defaults
jleibs Apr 24, 2023
27dfcdf
Fix bad workflow edit
jleibs Apr 24, 2023
52ae3a5
Add manual_ prefix to build_wheels_for_PR
jleibs Apr 24, 2023
4fe2265
Send build_summary to index.html
jleibs Apr 24, 2023
14d5c90
Standardize on more common - in github action names
jleibs Apr 25, 2023
fc193be
Clearer descriptions and README
jleibs Apr 25, 2023
576f359
More tweaks
jleibs Apr 25, 2023
15e2da9
Remove needs from Save PR
jleibs Apr 25, 2023
a1b63cc
Merge branch 'main' into jleibs/refactor_ci
jleibs Apr 25, 2023
66a59ab
Clean up copy-pasted comments
jleibs Apr 25, 2023
d32e3d3
Cleanup manual_build_wheels_for_pr
jleibs Apr 25, 2023
901417e
Detect PR rather than needing to enter it via form
jleibs Apr 25, 2023
0b1f940
Merge branch 'main' into jleibs/refactor_ci
jleibs Apr 25, 2023
e3de727
Cleanup generate_pr_summary.py
jleibs Apr 25, 2023
395bbd2
Merge branch 'main' into jleibs/refactor_ci
jleibs Apr 25, 2023
92cba84
Add extension to recommendations and readme
jleibs Apr 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Overview

Our CI workflows make heavy usage of [Reusable Workflows](https://docs.github.com/en/actions/using-workflows/reusing-workflows). These reusable workflows can then be tested manually via the `manual_dispatch.yml` workflow.
Or integrated into CI jobs such has `on_pull_request.yml` or `on_main.yml`.

By convention:
- All reusable workflows start with the `reusable_` prefix.
- All workflows that are triggered via `workflow_dispatch` start with the `manual_` prefix.
- All workflows that are triggered via an event start with the `on_` prefix.
- `on_pull_request` is triggered on pull requests.
- `on_main` is triggered on pushes to the main branch.

## Reusable Workflows
- [reusable_checks.yml](reusable_checks.yml) - These are all the checks that run to ensure the code is formatted,
linted, and tested. This job produces no artifacts other than a pass/fail criteria for the build.
- `SAVE_CACHE` - If true, the rust cache will be saved. Generally we only do this for builds on `main`
- [reusable_bench.yml](reusable_bench.yml) - This job runs the benchmarks to check for performance regressions.
- `SAVE_BENCH` - If true, then the benchmark results are saved to update https://ref.rerun.io/dev/bench/
- [reusable_deploy_docs](reusable_deploy_docs.yml) - This job deploys the python and rust documentation to https://ref.rerun.io
- `PY_DOCS_VERSION_NAME` - The name to use for versioning the python docs. This should generally match the version in
`Cargo.toml`.
- `UPDATE_LATEST` - If true, then the docs will be deployed to `latest/` as well as the versioned directory.
- [reusable_build_and_test_wheels.yml](reusable_build_and_test_wheels.yml) - This job builds the wheels, runs the
end-to-end test, and produces a sample RRD. The artifacts are accessible via GitHub artifacts, but not otherwise
uploaded anywhere.
- `MATURIN_FEATURE_FLAGS` - The feature flags to pass to maturin.
- `PLATFORM` - Which platform to build for: `linux`, `macos-arm`, `macos-intel`, or `windows`.
- `RELEASE_VERSION` - If producing a release, the version number. This must match the version in `Cargo.toml`.
- `RRD_ARTIFACT_NAME` - Intermediate name of the GitHub rrd artifact for passing to `reusable_upload_wheels.yml`
- `SAVE_CACHE` - If true, the rust cache will be saved. Generally we only do this for builds on `main`
- `WHEEL_ARTIFACT_NAME` - Intermediate name of the GitHub wheel artifact for passing to `reusable_upload_wheels.yml`
- [reusable_upload_wheels.yml](reusable_upload_wheels.yml) - This job uploads the wheels to google cloud
- `RRD_ARTIFACT_NAME` - Intermediate name of the GitHub rrd artifact. This should match the name passed to
`reusable_build_and_test_wheels.yml`
- `WHEEL_ARTIFACT_NAME` - Intermediate name of the GitHub wheel artifact. This should match the name passed to
`reusable_build_and_test_wheels.yml`
- [reusable_build_web.yml](reusable_build_web.yml) - This job builds the wasm artifacts for the web.
- `RELEASE_VERSION` - If producing a release, the version number. This must match the version in `Cargo.toml`.
- [reusable_upload_web.yml](reusable_upload_web.yml) - This job uploads the web assets to google cloud. By default this
only uploads to: `app.rerun.io/commit/<commit>/`
- `MARK_PRERELEASE_FOR_MAINLINE` - If true, then the web assets will go to `app.rerun.io/preleease/
- `MARK_TAGGED_VERSION` - If true, then the web assets will go to `app.rerun.io/version/<RELEASE_VERSION>`
- `RELEASE_VERSION` - If producing a release, the version number.
- `RRD_ARTIFACT_NAME` - Intermediate name of the GitHub rrd artifact. This should match the name passed to
`reusable_build_and_test_wheels.yml`
- `UPLOAD_COMMIT_OVERRIDE` - If set, will replace the value of `<commit>`. This is necessary because we want pull
request builds associated with their originating commit, even if the web-build happens on an ephemeral merge-commit.
- [reusable_pr_summary.yml](reusable_pr_summary.yml) - This job updates the PR summary with the results of the CI run.
- This summary can be found at:
`https://storage.googleapis.com/rerun-builds/pull_request/<PR_NUMBER>/index.html`
- `PR_NUMBER` - The PR number to update. This will generally be set by the `on_pull_request.yml` workflow using:
`${{github.event.pull_request.number}}`

## Manual Workflows
- [manual_dispatch](manual_dispatch.yml) - This workflow is used to manually trigger the assorted reusable workflows for
testing.
- See the workflow file for the list of parameters.
- [manual_build_wheels_for_pr.yml](manual_build_wheels_for_pr.yml) - This workflow can be dispatched on a branch and
will build all of the wheels for the associated pull-request. Uses:
- [reusable_build_and_test_wheels.yml](reusable_build_and_test_wheels.yml)
- [reusable_upload_wheels.yml](reusable_upload_wheels.yml)
- [reusable_pr_summary.yml](reusable_pr_summary.yml)
88 changes: 86 additions & 2 deletions .github/workflows/manual_build_wheels_for_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:

check_for_pr:
check-for-pr:
runs-on: ubuntu-latest
outputs:
PR_NUMBER: ${{ steps.get_pr.outputs.PR_NUMBER }}
Expand All @@ -24,5 +24,89 @@ jobs:
exit 1
else
echo "Commit is associated with PR: $pr_number"
echo "PR_NUMBER=$pr_number" >> "$GITHUB_OUTPUTS"
echo "PR_NUMBER=$pr_number" >> "$GITHUB_OUTPUT"
fi

build-linux:
needs: [check-for-pr]
name: 'Linux: Build/Test Wheels'
uses: ./.github/workflows/reusable_build_and_test_wheels.yml
with:
PLATFORM: linux
WHEEL_ARTIFACT_NAME: linux-wheel
RRD_ARTIFACT_NAME: linux-rrd
secrets: inherit

build-windows:
needs: [check-for-pr]
name: 'Windows: Build/Test Wheels'
uses: ./.github/workflows/reusable_build_and_test_wheels.yml
with:
PLATFORM: windows
WHEEL_ARTIFACT_NAME: windows-wheel
RRD_ARTIFACT_NAME: ''
secrets: inherit

build-macos-arm:
needs: [check-for-pr]
name: 'Macos-Arm: Build/Test Wheels'
uses: ./.github/workflows/reusable_build_and_test_wheels.yml
with:
PLATFORM: macos-arm
WHEEL_ARTIFACT_NAME: macos-arm-wheel
RRD_ARTIFACT_NAME: ''
secrets: inherit

build-macos-intel:
needs: [check-for-pr]
name: 'Macos-Intel: Build/Test Wheels'
uses: ./.github/workflows/reusable_build_and_test_wheels.yml
with:
PLATFORM: macos-intel
WHEEL_ARTIFACT_NAME: 'macos-intel-wheel'
RRD_ARTIFACT_NAME: ''
secrets: inherit

upload-wheels-linux:
name: 'Linux: Upload Wheels'
needs: [build-linux]
uses: ./.github/workflows/reusable_upload_wheels.yml
with:
WHEEL_ARTIFACT_NAME: linux-wheel
RRD_ARTIFACT_NAME: linux-rrd
secrets: inherit

upload-wheels-windows:
name: 'Windows: Upload Wheels'
needs: [build-linux, build-windows]
uses: ./.github/workflows/reusable_upload_wheels.yml
with:
WHEEL_ARTIFACT_NAME: windows-wheel
RRD_ARTIFACT_NAME: linux-rrd
secrets: inherit

upload-wheels-macos-arm:
name: 'Macos-Arm: Upload Wheels'
needs: [build-linux, build-macos-arm]
uses: ./.github/workflows/reusable_upload_wheels.yml
with:
WHEEL_ARTIFACT_NAME: macos-arm-wheel
RRD_ARTIFACT_NAME: linux-rrd
secrets: inherit

upload-wheels-macos-intel:
name: 'Macos-Intel: Upload Wheels'
needs: [build-linux, build-macos-intel]
uses: ./.github/workflows/reusable_upload_wheels.yml
with:
WHEEL_ARTIFACT_NAME: macos-intel-wheel
RRD_ARTIFACT_NAME: linux-rrd
secrets: inherit

update-pr-summary:
name: 'Update PR Summary'
needs: [check-for-pr, upload-wheels-linux, upload-wheels-windows, upload-wheels-macos-arm, upload-wheels-macos-intel]
uses: ./.github/workflows/reusable_pr_summary.yml
with:
PR_NUMBER: ${{ needs.check-for-pr.outputs.PR_NUMBER}}
secrets: inherit
Loading