Skip to content

Commit

Permalink
ci: fix test-reproducibility makefile targets, add to CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Feb 25, 2025
1 parent aea9ff9 commit c9d4645
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
with:
name: firefox
path: artifacts/firefox.zip
- name: Check reproducibility from src-zip
run: make test-reproducibility-firefox

- name: Build Chrome
run: make build-chrome
Expand All @@ -37,6 +39,8 @@ jobs:
with:
name: chrome
path: artifacts/chrome.zip
- name: Check reproducibility from src-zip
run: make test-reproducibility-chrome

typecheck:
runs-on: ubuntu-latest
Expand Down
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,28 @@ test-reproducibility-setup:

# Tests whether the zipped src reliably builds the same as the archive
test-reproducibility-chrome: zip-src build-chrome test-reproducibility-setup
(cd build/aw-watcher-web && make build-chrome && cp build.zip ../../artifacts/reproducibility-chrome.zip)
rm -r build/aw-watcher-web
wc -c artifacts/chrome.zip artifacts/reproducibility-chrome.zip | \
@echo "Building from src-zip..."
@(cd build/aw-watcher-web && make build-chrome && cp artifacts/chrome.zip ../../artifacts/reproducibility-chrome.zip)
@rm -r build/aw-watcher-web
@echo "Checking..."
@wc -c artifacts/chrome.zip artifacts/reproducibility-chrome.zip | \
sort -n | \
cut -d' ' -f2 | \
uniq -c | \
grep -q ' 2 ' \
|| (echo "build artifacts not the same size" && exit 1)
@echo "✅ Reproducibility test passed"

# Tests whether the zipped src reliably builds the same as the archive
test-reproducibility-firefox: zip-src build-firefox test-reproducibility-setup
(cd build/aw-watcher-web && make build-firefox && cp build.zip ../../artifacts/reproducibility-firefox.zip)
rm -r build/aw-watcher-web
wc -c aw-watcher-web.zip build/aw-watcher-web/aw-watcher-web.zip | \
@echo "Building from src-zip..."
@(cd build/aw-watcher-web && make build-firefox && cp artifacts/firefox.zip ../../artifacts/reproducibility-firefox.zip)
@rm -r build/aw-watcher-web
@echo "Checking..."
@wc -c artifacts/firefox.zip artifacts/reproducibility-firefox.zip | \
sort -n | \
cut -d' ' -f2 | \
uniq -c | \
grep -q ' 2 ' \
|| (echo "build artifacts not the same size" && exit 1)
@echo "✅ Reproducibility test passed"

0 comments on commit c9d4645

Please sign in to comment.