Skip to content

Commit ef379ee

Browse files
committed
Add versioning to simplicity contracts. Added tests and tooling for examples to have proper version
1 parent 0445ef9 commit ef379ee

34 files changed

+810
-178
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Check Example Versions
2+
3+
on:
4+
push:
5+
branches: [ "main", "master" ]
6+
pull_request:
7+
branches: [ "main", "master" ]
8+
9+
jobs:
10+
verify-pragmas:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Extract version from Cargo.toml
17+
id: get_version
18+
run: |
19+
# Grabs the first 'version = "X.Y.Z"' it sees in Cargo.toml
20+
VERSION=$(awk -F '\"' '/^version/ {print $2; exit}' Cargo.toml)
21+
echo "COMPILER_VERSION=$VERSION" >> $GITHUB_ENV
22+
echo "Detected Cargo version: $VERSION"
23+
24+
- name: Run the example updater script
25+
run: python3 update_examples.py ${{ env.COMPILER_VERSION }}
26+
27+
- name: Fail if examples are out of date
28+
run: |
29+
# Only check the examples directory for changes!
30+
if ! git diff --exit-code examples/; then
31+
echo "::error::The pragma versions in the examples/ folder are incorrect or missing!"
32+
exit 1
33+
fi

0 commit comments

Comments
 (0)