Skip to content

feat: opt-in non-Candid wire format via encoder / decoder parenthetical #19399

feat: opt-in non-Candid wire format via encoder / decoder parenthetical

feat: opt-in non-Candid wire format via encoder / decoder parenthetical #19399

Workflow file for this run

name: "build"
on:
push:
branches: [master]
pull_request: {}
merge_group: {}
permissions:
contents: write
issues: write
pull-requests: write
jobs:
common-tests:
strategy:
matrix:
os: [ubuntu-24-large, arm64-linux-16]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run Common Tests
uses: ./.github/actions/test-blueprint
with:
os: ${{ matrix.os }}
test-target: common-tests
test-name: ${{ matrix.os }}-common-tests
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
gc-tests:
strategy:
matrix:
os: [ubuntu-24-large, arm64-linux-16]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run GC Tests
uses: ./.github/actions/test-blueprint
with:
os: ${{ matrix.os }}
test-target: gc-tests
test-name: ${{ matrix.os }}-gc-tests
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
tests:
strategy:
matrix:
os: [ubuntu-24-large, arm64-linux-16]
build_type: [release, debug]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# fetch full history so that git merge-base works
fetch-depth: 0
# fetch PR commit, not predicted merge commit
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- name: Run Tests
uses: ./.github/actions/test-blueprint
with:
os: ${{ matrix.os }}
test-target: ${{ matrix.build_type }}-systems-go
test-name: ${{ matrix.os }}-${{ matrix.build_type }}-tests
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Create GitHub App Token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3
id: app-token
with:
app-id: ${{ vars.GENERIC_CI_RW_APP_ID }}
private-key: ${{ secrets.GENERIC_CI_RW_APP_PRIVATE_KEY }}
- name: Run Performance Tests
if: github.actor != 'dependabot[bot]' && github.event_name == 'pull_request' && runner.os == 'Linux' && runner.arch == 'X64' && matrix.build_type == 'release'
uses: ./.github/actions/performance
with:
head_sha: ${{ github.event.pull_request.head.sha }}
head_ref: ${{ github.event.pull_request.head.ref }}
base_ref: ${{ github.base_ref }}
pr_number: ${{ github.event.pull_request.number }}
is_fork: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
token: ${{ steps.app-token.outputs.token }}
reports:
if: github.ref == 'refs/heads/master'
needs: [tests]
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: cachix/install-nix-action@ab739621df7a23f52766f9ccc97f38da6b7af14f # v31.10.5
- uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
with:
name: ic-hs-test
- name: Fetch report
run: nix build .#report-site -o report-site
- name: Resolve symlinks
run: cp -rL report-site report-site-copy
- name: Push report to GitHub pages
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
with:
branch: gh-pages
folder: report-site-copy
single-commit: true
artifacts:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && contains(github.event.pull_request.labels.*.name, 'build_artifacts')
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: cachix/install-nix-action@ab739621df7a23f52766f9ccc97f38da6b7af14f # v31.10.5
- uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
with:
name: ic-hs-test
- name: nix-build
run: |
nix build .#release.moc
# upload-artifact doesn't work for symlink dir
# https://github.com/actions/upload-artifact/issues/92
- run: echo "UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV
- name: upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: moc-${{ matrix.os }}
path: ${{ env.UPLOAD_PATH }}
retention-days: 5
verify-common-gc:
needs: [common-tests, gc-tests]
if: ${{ always() }} # run even if dependencies failed/skipped/cancelled
runs-on: ubuntu-latest
steps:
- name: Show dependency results
run: |
echo common-tests: ${{ needs.common-tests.result }}
echo gc-tests: ${{ needs.gc-tests.result }}
- name: Fail if any dependency did not succeed
run: |
if ${{ needs.common-tests.result != 'success' || needs.gc-tests.result != 'success' }}; then
echo "One or more dependencies failed/skipped/cancelled."
exit 1
fi
- name: Common and GC tests passed
if: ${{ success() }}
run: echo "Common and GC tests completed successfully."
verify-main-tests:
needs: tests
if: ${{ always() }} # run even if dependencies failed/skipped/cancelled
runs-on: ubuntu-latest
steps:
- name: Show dependency results
run: |
echo tests: ${{ needs.tests.result }}
- name: Fail if any dependency did not succeed
run: |
if ${{ needs.tests.result != 'success' }}; then
echo "One or more dependencies failed/skipped/cancelled."
exit 1
fi
- name: Main test passed
if: ${{ success() }}
run: echo "Main test completed successfully."
autoclose:
if: github.event_name == 'pull_request' && github.event.pull_request.state == 'open' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.ref == 'master' && contains(github.event.pull_request.labels.*.name, 'autoclose')
needs: [verify-common-gc, verify-main-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "master"
- name: Automatically closing successful trials
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr close ${{ github.event.pull_request.number }} --delete-branch --comment "CI looks good, this dependency bump would not cause problems, hence closing this trial PR."
gh pr edit ${{ github.event.pull_request.number }} --remove-label "autoclose"
approvals:
if: github.event_name == 'pull_request' && github.event.pull_request.state == 'open' && github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.base.ref == 'master' && github.event.pull_request.changed_files == 1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "master"
- name: Create GitHub App Token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3
id: app-token-for-approvals
with:
app-id: ${{ vars.GENERIC_CI_RW_APP_ID }}
private-key: ${{ secrets.GENERIC_CI_RW_APP_PRIVATE_KEY }}
- name: Hand out single-file review approvals
env:
GH_TOKEN: ${{ steps.app-token-for-approvals.outputs.token }}
PR: ${{ github.event.pull_request.number }}
run: |
set +e
### Handles open PRs that address `master` and only have one changed file. The body checks whether that is the `Changelog.md` (since the `if:` condition can't). If so, the PR gets approved with a comment.
[ $(gh pr diff $PR --name-only) == "Changelog.md" ] \
&& gh pr review $PR --approve --body 'A change to `Changelog.md`? I can handle that!'
### Handles open PRs filed by `dependabot[bot]` that carry the `dependencies` label. The single changed file must be `doc/docusaurus/package-lock.json`. If so, the PR gets approved with a comment.
${{ github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'dependencies') }} \
&& [ $(gh pr diff $PR --name-only) == "doc/docusaurus/package-lock.json" ] \
&& gh pr review $PR --approve --body 'A change to `doc/docusaurus/package-lock.json`? I can handle that!' \
&& gh pr merge $PR --squash --auto
### Handles open PRs filed by the GH automation bot that carry the `automerge-squash` label. The single changed file must be `flake.lock`. If so, the PR gets approved with a comment, auto-merge activated and the label removed.
${{ github.event.pull_request.user.login == 'caffeine-ci-generic-rw[bot]' && contains(github.event.pull_request.labels.*.name, 'automerge-squash') }} \
&& [ $(gh pr diff $PR --name-only) == "flake.lock" ] \
&& gh pr review $PR --approve --body 'A change to `flake.lock`? I can handle that!' \
&& gh pr merge $PR --squash --auto \
&& gh pr edit $PR --remove-label 'automerge-squash'
true