diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b7bd865..eec2ad6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,20 +4,20 @@ name: Release # This GitHub action creates a release when manually run with signer details on: workflow_dispatch: - inputs: - CS_ID: - description: "Code Signing ID" - required: true - type: string - CS_API_TOKEN: - description: "Code Signing API Token" - required: true - type: string +# inputs: +# CS_ID: +# description: "Code Signing ID" +# required: true +# type: string +# CS_API_TOKEN: +# description: "Code Signing API Token" +# required: true +# type: string -# Releases need permissions to read and write the repository contents. -# GitHub considers creating releases and uploading assets as writing contents. -permissions: - contents: write +# # Releases need permissions to read and write the repository contents. +# # GitHub considers creating releases and uploading assets as writing contents. +# permissions: +# contents: write jobs: acceptance-tests: @@ -32,36 +32,36 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Inject Env File - run: echo "${{ secrets.ACCEPTANCE_ENV }}" > acceptance.env + run: echo "${{ secrets.ACCEPTANCE_ENV_FILE }}" > acceptance.env - name: Run Acceptance Tests run: just acceptance-tests acceptance.env - goreleaser: - runs-on: Signer - needs: acceptance-tests - steps: - - uses: actions/checkout@v4.2.2 - with: - # Allow goreleaser to access older tag information. - fetch-depth: 0 + # goreleaser: + # runs-on: Signer + # needs: acceptance-tests + # steps: + # - uses: actions/checkout@v4.2.2 + # with: + # # Allow goreleaser to access older tag information. + # fetch-depth: 0 - - name: Setup Just - uses: extractions/setup-just@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Setup Just + # uses: extractions/setup-just@v2 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-go@v5.1.0 - with: - go-version-file: 'go.mod' - cache: true + # - uses: actions/setup-go@v5.1.0 + # with: + # go-version-file: 'go.mod' + # cache: true - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v6.0.0 - with: - args: release --clean - env: - # GitHub sets the GITHUB_TOKEN secret automatically. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CS_ID: ${{ inputs.CS_ID }} - CS_API_TOKEN: ${{ inputs.CS_API_TOKEN }} + # - name: Run GoReleaser + # uses: goreleaser/goreleaser-action@v6.0.0 + # with: + # args: release --clean + # env: + # # GitHub sets the GITHUB_TOKEN secret automatically. + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # CS_ID: ${{ inputs.CS_ID }} + # CS_API_TOKEN: ${{ inputs.CS_API_TOKEN }} diff --git a/.github/workflows/test-acceptance.yaml b/.github/workflows/test-acceptance.yaml new file mode 100644 index 0000000..08b34d6 --- /dev/null +++ b/.github/workflows/test-acceptance.yaml @@ -0,0 +1,24 @@ +# Terraform Provider release workflow. +name: TestAcceptance + +# This GitHub action creates a release when manually run with signer details +on: + workflow_dispatch: + +jobs: + acceptance-tests: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup Just + uses: extractions/setup-just@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Inject Env File + run: echo "${{ secrets.ACCEPTANCE_ENV_FILE }}" > acceptance.env + + - name: Run Acceptance Tests + run: just acceptance-tests acceptance.env diff --git a/Justfile b/Justfile index 504bef6..ba5079e 100644 --- a/Justfile +++ b/Justfile @@ -99,9 +99,8 @@ coverage-provider: tidy-tools: cd {{ TOOLS_PROVIDER_DIR }} && go mod tidy -acceptance-tests ENV_PATH='' +ARGS='': +acceptance-tests ENV_PATH=''+ARGS='': #!/usr/bin/env bash - set -e if [ -z "{{ ENV_PATH }}" ]; then echo "Error: ENV_PATH argument is required" >&2 @@ -113,18 +112,13 @@ acceptance-tests ENV_PATH='' +ARGS='': exit 1 fi - read -p "This is going to run requests against UXI backend. Continue (y/Y)? " -n 1 -r - echo - if [[ $REPLY =~ ^[Yy]$ ]] - then - # we run these separately so that they do not interfere with each other since GoLang executes - # tests in different directories at the same time - for dir in "datasources" "resources" - do - echo "Running tests in $dir..." - env $(cat {{ ENV_PATH }} | xargs) TF_ACC=1 go test -v ./test/live/$dir/... -race {{ ARGS }} - done - fi + # we run these separately so that they do not interfere with each other since GoLang executes + # tests in different directories at the same time + for dir in "datasources" "resources" + do + echo "Running tests in $dir..." + env $(cat {{ ENV_PATH }} | xargs) TF_ACC=1 go test -v ./test/live/$dir/... -race {{ ARGS }} + done test +ARGS='': just test-client {{ ARGS }}