Skip to content

Commit

Permalink
Create make target for testing reproducible builds
Browse files Browse the repository at this point in the history
Migrate the logic of the reproducible build check from CI to the
Makefile in order to make it convenient to run the test offline too. The
CI now uses this new make target to avoid duplication of the test logic.

Signed-off-by: Eric Cornelissen <ericornelissen@gmail.com>
  • Loading branch information
ericcornelissen committed May 11, 2024
1 parent 3070a2f commit 66f1e49
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,8 @@ jobs:
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: go.mod
- name: Build
run: make build
- name: Compute checksum
run: shasum ades | tee checksums.txt
- name: Clear build
run: make clean
- name: Rebuild
run: make build
- name: Verify checksum
run: shasum --check checksums.txt --strict
- name: Check reproducibility
run: make reproducible
test-unit:
name: Unit test
runs-on: ubuntu-22.04
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ release-compile:
@echo 'Computing checksums...'
@cd _compiled/ && shasum --algorithm 512 ./* >'checksums-sha512.txt'

.PHONY: reproducible
reproducible:
@make build
@shasum ades | tee checksums.txt
@make clean build
@shasum --check checksums.txt --strict

.PHONY: run
run: ## Run the project on itself
@go run ./cmd/ades
Expand Down

0 comments on commit 66f1e49

Please sign in to comment.