diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 59c9966..9b4b599 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,8 +20,9 @@ jobs: pip install -r functions/replace-route/tests/test_requirements.txt python -m pytest - golang_lint: + terraform_tests: permissions: + id-token: write contents: read runs-on: ubuntu-latest defaults: @@ -34,46 +35,23 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: test/go.mod + cache-dependency-path: test/go.sum - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.53 - working-directory: ./test - - # use config in .golangci.yaml to configure the action further - # terraform_tests: - # permissions: - # id-token: write - # contents: read - # runs-on: ubuntu-latest - # defaults: - # run: - # working-directory: ./test - # steps: - # - uses: actions/checkout@v4 - - # - name: Install Go - # uses: actions/setup-go@v5 - # with: - # go-version-file: test/go.mod - # cache-dependency-path: test/go.sum + - name: Go Tidy + run: go mod tidy && git diff --exit-code - # - name: Go Tidy - # run: go mod tidy && git diff --exit-code + - name: Go Mod + run: go mod download - # - name: Go Mod - # run: go mod download + - name: Go mod verify + run: go mod verify - # - name: Go mod verify - # run: go mod verify + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.TERRATEST_ROLE_TO_ASSUME }} + aws-region: ${{ secrets.AWS_REGION }} - # - name: Configure AWS Credentials - # uses: aws-actions/configure-aws-credentials@v4 - # with: - # role-to-assume: ${{ secrets.TERRATEST_ROLE_TO_ASSUME }} - # aws-region: ${{ secrets.AWS_REGION }} + - name: Run tests + run: go test -v -timeout 60m - # - name: Run tests - # run: go test -v -timeout 60m - diff --git a/.golangci.yaml b/.golangci.yaml deleted file mode 100644 index a6142af..0000000 --- a/.golangci.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# https://golangci-lint.run/usage/configuration/#config-file -run: - allow-parallel-runners: true - timeout: 5m - go: '1.20' - skip-dirs-use-default: false - -linters: - enable: - - errcheck - - errorlint - - exportloopref - - gocritic - - gofmt - - goimports - - gosec - - govet - - misspell - - revive - - staticcheck - - tenv - - unconvert - - unused - - unparam - -issues: - # Excluding configuration per-path, per-linter, per-text and per-source - exclude-rules: - - text: "G306:" - linters: - - gosec - - text: "G204:" - linters: - - gosec - - text: "G112:" - linters: - - gosec