Skip to content

Commit

Permalink
Merge pull request #53 from hashicorp/smre-177-node20-update
Browse files Browse the repository at this point in the history
SMRE-177 update to Node20
  • Loading branch information
sarahethompson committed May 8, 2024
2 parents 0da08f8 + 9209078 commit 37358f6
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
# Dogfood this Action to build its own CLI.
- uses: ./
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/example-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
- { runner: macos-latest, os: darwin, arch: amd64, tags: netcgo }
- { runner: macos-latest, os: darwin, arch: arm64, tags: netcgo }
- { runner: ubuntu-latest, os: linux, arch: amd64, env: CGO_ENABLED=0 }
- { runner: ubuntu-latest, os: linux, arch: amd64, env: CGO_ENABLED=0 }
- { runner: ubuntu-latest, os: linux, arch: arm64, env: CGO_ENABLED=0 }
- { runner: ubuntu-latest, os: windows, arch: amd64, env: CGO_ENABLED=0 }
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Build
uses: hashicorp/actions-go-build@main
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/example-matrix.yml.currentbranch.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Build
uses: hashicorp/actions-go-build@main
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/example.yml.currentbranch.yml

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

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Build CLI Binaries
run: make release/zips
- name: Create GitHub Release
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/self-test-suite-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ jobs:
- { assert: failure, file: this-file-does-not-exist, when: result file is missing }
- { assert: failure, file: corrupt, when: result file is corrupt }
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
# generate a random ID; GH doesn't provide a proper job ID (especially for matrix jobs)
- name: Generate random ID to distinguish build artifacts
run: echo "ARTIFACT_ID=$RANDOM" >> "$GITHUB_ENV"
- uses: ./verify/self-test
with:
assert: ${{ matrix.assert }}
when: ${{ matrix.when }}
result_file: verify/testdata/${{ matrix.file }}.buildresult.json
output_file: verification-result-${{ inputs.runner }}.json
output_file: verification-result-${{ inputs.runner }}-${{ env.ARTIFACT_ID }}.json
37 changes: 31 additions & 6 deletions .github/workflows/self-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
# with different sets of inputs, and assert that the action succeeds or
# fails correctly.

# Each test uses a distinct product_name that must account for both the job name
# and the variants introduced via job matrix in order to avoid duplicate artifact
# names (which cannot be uploaded as of actions/upload-artifact@v4.

# A single reproducible go binary.
ok-single-file:
runs-on: ${{ inputs.runner }}
Expand All @@ -28,9 +32,13 @@ jobs:
- { reproducible: report, want: success }
- { reproducible: nope, want: success }
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: select OS value
run: case "${{ runner.os }}" in macOS) echo "SELECTED_OS=darwin" >> "$GITHUB_ENV" ;; Linux) echo "SELECTED_OS=linux" >> "$GITHUB_ENV" ;; esac
- uses: ./self-test
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
os: ${{ env.SELECTED_OS }}
reproducible: ${{ matrix.reproducible }}
assert: ${{ matrix.want }}
when: "the binary files are identical and there are no other files in the zip"
Expand All @@ -49,9 +57,13 @@ jobs:
- { reproducible: report, want: success }
- { reproducible: nope, want: success }
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: select OS value
run: case "${{ runner.os }}" in macOS) echo "SELECTED_OS=darwin" >> "$GITHUB_ENV" ;; Linux) echo "SELECTED_OS=linux" >> "$GITHUB_ENV" ;; esac
- uses: ./self-test
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
os: ${{ env.SELECTED_OS }}
reproducible: ${{ matrix.reproducible }}
assert: ${{ matrix.want }}
when: "the binary files are identical and so are two other files in the zip"
Expand Down Expand Up @@ -79,11 +91,12 @@ jobs:
- { reproducible: report, os: darwin, arch: arm64, want: success }
- { reproducible: nope, os: darwin, arch: arm64, want: success }
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
if: runner.os == 'macOS'
- uses: ./self-test
if: runner.os == 'macOS'
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
reproducible: ${{ matrix.reproducible }}
Expand All @@ -104,9 +117,13 @@ jobs:
- { reproducible: report, want: success }
- { reproducible: nope, want: success }
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: select OS value
run: case "${{ runner.os }}" in macOS) echo "SELECTED_OS=darwin" >> "$GITHUB_ENV" ;; Linux) echo "SELECTED_OS=linux" >> "$GITHUB_ENV" ;; esac
- uses: ./self-test
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
os: ${{ env.SELECTED_OS }}
reproducible: ${{ matrix.reproducible }}
assert: ${{ matrix.want }}
when: "the binary files reproduce but the zip files do not"
Expand All @@ -127,9 +144,13 @@ jobs:
- { reproducible: report, want: success }
- { reproducible: nope, want: success }
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: select OS value
run: case "${{ runner.os }}" in macOS) echo "SELECTED_OS=darwin" >> "$GITHUB_ENV" ;; Linux) echo "SELECTED_OS=linux" >> "$GITHUB_ENV" ;; esac
- uses: ./self-test
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
os: ${{ env.SELECTED_OS }}
reproducible: ${{ matrix.reproducible }}
assert: ${{ matrix.want }}
when: "neither the binary file not the zip file reproduce"
Expand All @@ -149,9 +170,13 @@ jobs:
- { reproducible: report, want: failure }
- { reproducible: nope, want: failure }
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: select OS value
run: case "${{ runner.os }}" in macOS) echo "SELECTED_OS=darwin" >> "$GITHUB_ENV" ;; Linux) echo "SELECTED_OS=linux" >> "$GITHUB_ENV" ;; esac
- uses: ./self-test
with:
product_name: "example-app-${{ github.job }}-${{ matrix.reproducible }}"
os: ${{ env.SELECTED_OS }}
reproducible: ${{ matrix.reproducible }}
assert: ${{ matrix.want }}
when: "the binary file is not written to the correct path"
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ name: Test
on:
push:
paths:
- '**'
- '!**.md'
- '!dev/**'
- '!verify/**'
- '!action.yml'
- "**"
- "!**.md"
- "!dev/**"
- "!verify/**"
- "!action.yml"

jobs:

lint:
runs-on: ubuntu-latest
steps:
- uses: github/super-linter@45fc0d88288beee4701c62761281edfee85655d7 # v5.0.0
- uses: github/super-linter@4e51915f4a812abf59fed160bb14595c0a38a9e7 # v6

go-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: go.mod
cache: false
- run: make test/go
13 changes: 8 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,22 @@ runs:
steps:

# Setup Go for CLI compilation.
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.18
cache: false

- name: Action Setup
shell: bash
working-directory: ${{ github.action_path }}
run: ./action-setup

# Setup Go
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ inputs.go_version }}
cache: false


# Read config.
- name: Read config from inputs; export to GITHUB_ENV
Expand All @@ -119,7 +122,7 @@ runs:

# Upload Primary Build
- name: Upload Primary Zip
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: ${{ env.ZIP_NAME }}
path: ${{ env.ZIP_PATH_PRIMARY }}
Expand All @@ -135,7 +138,7 @@ runs:
# Upload Local Verification Build
- name: Upload Local Verification Zip
if: inputs.reproducible == 'assert' || inputs.reproducible == 'report'
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: ${{ env.ZIP_NAME }}.local-verification-build.zip
path: ${{ env.ZIP_PATH_VERIFICATION }}
Expand Down Expand Up @@ -168,7 +171,7 @@ runs:
# Upload Verification Result
- name: Upload Verification Result
if: inputs.reproducible == 'assert' || inputs.reproducible == 'report'
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: ${{ env.ZIP_NAME }}.verificationresult.json
path: ${{ env.VERIFICATION_RESULT }}
Expand Down
2 changes: 1 addition & 1 deletion self-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ runs:
id: build
uses: ./ # The action at the root of this repo.
with:
product_name: ${{ inputs.product_name }}_${{ github.job }}
product_name: ${{ inputs.product_name }}
product_version: ${{ inputs.product_version }}
go_version: ${{ inputs.go_version }}
os: ${{ inputs.os }}
Expand Down
8 changes: 5 additions & 3 deletions verify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ runs:
steps:

# Setup Go for CLI compilation.
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: 1.18
cache: false

- name: Action Setup
shell: bash
Expand Down Expand Up @@ -74,9 +75,10 @@ runs:
$RUN_CLI inspect -build-config "$RESULT_FILE"
# Setup Go For Running the Verification Build
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache: false

# Verify Reproducibility
- name: Verify Reproducibility
Expand All @@ -95,7 +97,7 @@ runs:
# Store reproducibility report.
- name: Upload Reproducibility Report
if: always()
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
path: ${{ env.VERIFICATION_RESULT }}
name: ${{ env.OUTPUT_FILE }}
Expand Down

0 comments on commit 37358f6

Please sign in to comment.