Skip to content

Commit

Permalink
ci: check contract artifact staleness (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI authored Nov 8, 2023
1 parent 5f1e5cd commit a34f94f
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
push:
branches:
- "master"
pull_request:

name: "Validate contract artifacts"

jobs:
check-artifacts:
name: "Check artifacts"
runs-on: "ubuntu-latest"

steps:
- name: "Checkout source code"
uses: "actions/checkout@v3"
with:
submodules: true

- name: "Generate artifacts (Cairo 0)"
run: |
cd ./starknet-core/test-data/contracts/cairo0
./generate_artifacts.sh
- name: "Generate artifacts (Cairo 1)"
run: |
cd ./starknet-core/test-data/contracts/cairo1
./generate_artifacts.sh
- name: "Generate artifacts (Cairo 2)"
run: |
cd ./starknet-core/test-data/contracts/cairo2
./generate_artifacts.sh
- name: "Check Git diffs"
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Git diffs found. Make sure contract artifacts are up to date." >&2
exit 1
fi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Deterministically generate contract artifacts

docker run -it --rm \
docker run --rm \
-v "$(pwd)/artifacts:/artifacts" \
-v "$(pwd)/contracts:/contracts:ro" \
-v "$(pwd)/docker_entry.sh:/entry.sh:ro" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

# Deterministically generate contract artifacts

docker run -it --rm \
docker run --rm \
-v "$(pwd)/artifacts:/artifacts" \
-v "$(pwd)/contracts:/contracts:ro" \
-v "$(pwd)/docker_entry_compile.sh:/entry.sh:ro" \
Expand All @@ -14,7 +14,7 @@ docker run -it --rm \
starknet/cairo:1.1.0


docker run -it --rm \
docker run --rm \
-v "$(pwd)/artifacts:/artifacts" \
-v "$(pwd)/docker_entry_hashes.sh:/entry.sh:ro" \
-v "$(pwd)/scripts/generate_hashes.py:/generate_hashes.py:ro" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

# Deterministically generate contract artifacts

docker run -it --rm \
docker run --rm \
-v "$(pwd)/artifacts:/artifacts" \
-v "$(pwd)/contracts:/contracts:ro" \
-v "$(pwd)/docker_entry_compile.sh:/entry.sh:ro" \
Expand All @@ -14,7 +14,7 @@ docker run -it --rm \
starknet/cairo:2.1.0


docker run -it --rm \
docker run --rm \
-v "$(pwd)/artifacts:/artifacts" \
-v "$(pwd)/docker_entry_hashes.sh:/entry.sh:ro" \
-v "$(pwd)/scripts/generate_hashes.py:/generate_hashes.py:ro" \
Expand Down

0 comments on commit a34f94f

Please sign in to comment.