Fix build workflow is failing (#608)

This commit is contained in:
Elbaz 2023-09-28 11:24:30 +03:00 committed by GitHub
parent e1cab37503
commit 8f8e25c6ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 11 deletions

View File

@ -7,12 +7,12 @@ set -uo pipefail
if [[ $arch == 'arm' || $arch == 'arm64' ]]
then
export DIR=$(mktemp -d)
unzip -d $DIR "${e2e_cache_path}/opentofu-e2etest_${os}_${arch}.zip"
unzip -d $DIR "./opentofu_${version}_${os}_${arch}.zip"
unzip -d $DIR "${e2e_cache_path}/tofu-e2etest_${os}_${arch}.zip"
unzip -d $DIR "./tofu_${version}_${os}_${arch}.zip"
sudo chmod +x $DIR/e2etest
docker run --platform=linux/arm64 -v $DIR:/src -w /src arm64v8/alpine ./e2etest -test.v
else
unzip "${e2e_cache_path}/opentofu-e2etest_${os}_${arch}.zip"
unzip "./opentofu_${version}_${os}_${arch}.zip"
unzip "${e2e_cache_path}/tofu-e2etest_${os}_${arch}.zip"
unzip "./tofu_${version}_${os}_${arch}.zip"
TF_ACC=1 ./e2etest -test.v
fi

View File

@ -22,7 +22,10 @@ on:
type: string
package-name:
type: string
default: opentofu
default: tofu
bin-name:
type: string
default: tofu
product-version:
type: string
required: true
@ -53,7 +56,8 @@ jobs:
CGO_ENABLED: ${{ inputs.cgo-enabled }}
uses: hashicorp/actions-go-build@v0.1.7
with:
product_name: ${{ inputs.package-name }}
bin_name: ${{ inputs.bin-name }}
product_name: ${{ inputs.product-name }}
product_version: ${{ inputs.product-version }}
go_version: ${{ inputs.go-version }}
os: ${{ inputs.goos }}

View File

@ -16,7 +16,7 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+*'
env:
PKG_NAME: "opentofu"
PKG_NAME: "tofu"
permissions:
contents: read
@ -256,13 +256,13 @@ jobs:
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
id: clipkg
with:
name: opentofu_${{env.version}}_${{ env.os }}_${{ env.arch }}.zip
name: tofu_${{env.version}}_${{ env.os }}_${{ env.arch }}.zip
path: .
- name: Extract packages
if: ${{ matrix.goos == 'windows' }}
run: |
unzip "${{ needs.e2etest-build.outputs.e2e-cache-path }}/tofu-e2etest_${{ env.os }}_${{ env.arch }}.zip"
unzip "./opentofu_${{env.version}}_${{ env.os }}_${{ env.arch }}.zip"
unzip "./tofu_${{env.version}}_${{ env.os }}_${{ env.arch }}.zip"
- name: Set up QEMU
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
if: ${{ contains(matrix.goarch, 'arm') }}
@ -305,7 +305,7 @@ jobs:
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
id: clipkg
with:
name: opentofu_${{ env.version }}_linux_amd64.zip
name: tofu_${{ env.version }}_linux_amd64.zip
path: .
- name: Checkout tofu-exec repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
@ -315,7 +315,7 @@ jobs:
- name: Run tofu-exec end-to-end tests
run: |
FULL_RELEASE_VERSION="${{ env.version }}"
unzip opentofu_${FULL_RELEASE_VERSION}_linux_amd64.zip
unzip tofu_${FULL_RELEASE_VERSION}_linux_amd64.zip
export TFEXEC_E2ETEST_TERRAFORM_PATH="$(pwd)/tofu"
cd tofu-exec
go test -race -timeout=30m -v ./tfexec/internal/e2etest