Skip to content

Commit

Permalink
[chore] Use hugr_validator from the cache in CI (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
croyzor committed Jul 25, 2024
1 parent 9f23b9e commit ffa0c53
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ jobs:
~/.stack
.stack-work
~/.cargo
# Rust dependencies
hugr_validator/target/deps
hugr_validator/target/build
# best effort for cache: tie it to Stack resolver and package config
key: ${{ runner.os }}-stack-${{ hashFiles('brat/stack.yaml', 'hugr_validator/Cargo.toml') }}
key: ${{ runner.os }}-stack-${{ hashFiles('brat/stack.yaml',
'hugr_validator/Cargo.toml',
'hugr_extension/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-stack
save-always: true
Expand All @@ -49,11 +48,21 @@ jobs:
run: stack test --ta --hide-successes

# Validate the hugr outputs
- name: Check for hugr_validator
id: cached_validator
run: |
if [ -f ~/.cargo/bin/hugr_validator ]; then
echo "out=true" >> $GITHUB_OUTPUT
else
echo "We need to build hugr_validator"
echo "out=false" >> $GITHUB_OUTPUT
fi
- name: Install rust
if: ${{ steps.cached_validator.outputs.out != 'true' }}
uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
- name: Install hugr_validator
if: ${{ steps.cached_validator.outputs.out != 'true' }}
run: cargo install --path ../hugr_validator
- name: Validate compilation output
run: tools/validate.sh

0 comments on commit ffa0c53

Please sign in to comment.