Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail early when worktree dirty #25

Merged
merged 13 commits into from Jan 11, 2023
4 changes: 2 additions & 2 deletions action.yml
Expand Up @@ -112,7 +112,7 @@ runs:
- name: Run Primary Build
shell: bash
working-directory: ${{ inputs.work_dir }}
run: $RUN_CLI build
run: $RUN_CLI build -clean -json
samsalisbury marked this conversation as resolved.
Show resolved Hide resolved

# Upload Primary Build
- name: Upload Primary Zip
Expand All @@ -127,7 +127,7 @@ runs:
if: inputs.reproducible == 'assert' || inputs.reproducible == 'report'
shell: bash
working-directory: ${{ inputs.work_dir }}
run: $RUN_CLI build -verification
run: $RUN_CLI build -clean -json -verification
samsalisbury marked this conversation as resolved.
Show resolved Hide resolved

# Upload Local Verification Build
- name: Upload Local Verification Zip
Expand Down
25 changes: 25 additions & 0 deletions e2e/test.bats
@@ -0,0 +1,25 @@
#!/usr/bin/env bats

set -Eeuo pipefail

# This tests that we get the same verification zip path when we run the commands:
#
# - config
# - inspect -build-config -verification
# - build -verification
@test "verification output paths match" {
rm -rf dist/ out/
CONFIG="$(actions-go-build config | grep ZIP_PATH_VERIFICATION | grep -Eo '/.*$')"
BUILDENV="$(actions-go-build inspect --build-config --verification | jq -r .Paths.ZipPath)"
actions-go-build build -q
BUILD="$(actions-go-build build -q -verification -json | jq -r .Config.Paths.ZipPath)"

echo "$CONFIG"
echo "$BUILDENV"
echo "$BUILD"

diff <(echo "$CONFIG") <(echo "$BUILDENV")
diff <(echo "$CONFIG") <(echo "$BUILD")
samsalisbury marked this conversation as resolved.
Show resolved Hide resolved

[[ "$CONFIG" == "$BUILDENV" ]]
}
samsalisbury marked this conversation as resolved.
Show resolved Hide resolved
34 changes: 19 additions & 15 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.