Skip to content

ci: Make an issue when ops are missing, instead of messaging slack #296

ci: Make an issue when ops are missing, instead of messaging slack

ci: Make an issue when ops are missing, instead of messaging slack #296

Workflow file for this run

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/sccache-action@v0.0.6
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Set up uv
uses: astral-sh/setup-uv@v3
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
if [ $? -eq 0 ]; then
echo "The test passed."
echo "fail=false" >> $GITHUB_OUTPUT
else
echo "The test failed with error code $?."
echo
cat missing_optypes.txt
echo "fail=true" >> $GITHUB_OUTPUT
fi
echo "diagnostic=$(cat missing_optypes.txt)" >> $GITHUB_OUTPUT
create-issue:
uses: CQCL/hugrverse-actions/.github/workflows/create-issue.yml@main

Check failure on line 60 in .github/workflows/missing-ops.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/missing-ops.yml

Invalid workflow file

error parsing called workflow ".github/workflows/missing-ops.yml" -> "CQCL/hugrverse-actions/.github/workflows/create-issue.yml@main" : failed to fetch workflow: workflow was not found.
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.
```
$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 }}
DIAGNOSTIC: ${{ needs.missing-optypes.outputs.diagnostic }}