ci: Fix invalid syntax in missing ops workflow (#109) #360
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Detect missing operation definitions | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: {} | |
schedule: | |
# 08:00 daily | |
- cron: '0 8 * * *' | |
env: | |
CARGO_TERM_COLOR: always | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
# Pinned version for the uv package manager | |
UV_VERSION: "0.5.1" | |
UV_FROZEN: 1 | |
jobs: | |
missing-optypes: | |
name: Check for missing op type definitions | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
outputs: | |
should_notify: ${{ steps.check_missing_optypes.outputs.fail }} | |
diagnostic: ${{ steps.check_missing_optypes.outputs.diagnostic }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mozilla-actions/[email protected] | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt, clippy | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v4 | |
with: | |
version: ${{ env.UV_VERSION }} | |
enable-cache: true | |
- name: Run the missing op types test | |
id: check_missing_optypes | |
run: | | |
set +e | |
uv run -- cargo test --test integration -- --ignored missing_optypes --nocapture --test-threads=1 > missing_optypes.txt | |
cat missing_optypes.txt | |
echo | |
if [ $? -eq 0 ]; then | |
echo "The test passed." | |
echo "fail=false" >> $GITHUB_OUTPUT | |
else | |
echo "The test failed with error code $?." | |
echo "fail=true" >> $GITHUB_OUTPUT | |
fi | |
echo "diagnostic<<EOF" >> $GITHUB_OUTPUT | |
cat missing_optypes.txt >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
create-issue: | |
uses: CQCL/hugrverse-actions/.github/workflows/create-issue.yml@main | |
needs: missing-optypes | |
if: ${{ needs.missing-optypes.outputs.should_notify == 'true' && ( github.event_name == 'schedule' || github.event_name == 'push' ) }} | |
with: | |
title: "`tket-json-rs` is missing OpType definitions." | |
body: | | |
⚠️ `tket-json-rs` is missing OpType definitions. | |
``` | |
${{ needs.missing-optypes.outputs.diagnostic }} | |
``` | |
See [https://github.com/CQCL/tket-json-rs/actions/runs/${{ github.run_id }}](the failing check) for more info. | |
unique-label: "missing-ops" | |
other-labels: "bug" | |
secrets: | |
GITHUB_PAT: ${{ secrets.HUGRBOT_PAT }} |