diff --git a/.github/workflows/licenses.yaml b/.github/workflows/licenses.yaml index 7496e0a..c06baf4 100644 --- a/.github/workflows/licenses.yaml +++ b/.github/workflows/licenses.yaml @@ -1,6 +1,10 @@ name: "License verification" on: pull_request: + +env: + GO_VERSION: 1.20.7 + jobs: dependency_info_linux: name: "Verify use of forbidden licenses" @@ -15,7 +19,7 @@ jobs: ref: "${{ github.event.pull_request.head.sha }}" - uses: actions/setup-go@v3 with: - go-version: 1.20.6 + go-version: "${{ env.GO_VERSION }}" - name: "Generate dependency information" shell: bash run: make generate diff --git a/.github/workflows/test_lint.yaml b/.github/workflows/test_lint.yaml new file mode 100644 index 0000000..59ae3cc --- /dev/null +++ b/.github/workflows/test_lint.yaml @@ -0,0 +1,48 @@ +name: "Test and Lint" + +on: + push: + branches: + - "**" + pull_request: + branches: + - "**" + +env: + GO_VERSION: 1.20.7 + +jobs: + + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout local + uses: actions/checkout@v3 + + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: "${{env.GO_VERSION}}" + + - name: Lint + run: | + make lint + + go-unit-tests: + runs-on: ubuntu-latest + steps: + - name: Checkout local + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: "${{ github.event.pull_request.head.sha }}" + + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: "${{env.GO_VERSION}}" + + - name: go unit tests + run: | + make go-unit-test diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml deleted file mode 100644 index 6beb1d5..0000000 --- a/.github/workflows/unit_tests.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: "Unit test" -on: - pull_request: -jobs: - unittest: - runs-on: ubuntu-latest - steps: - - name: Git Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - ref: "${{ github.event.pull_request.head.sha }}" - - name: Get Last Run - uses: ./.github/actions/rerun-cache - id: get_last_run - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: 1.20.6 - - name: Lint - run: make lint - - name: Run Tests - if: steps.get_last_run.outputs.passed != 'success' - run: make unit-test - - name: Report Success - run: echo "::set-output name=run_result::success" > run_result diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index eaf6592..2163259 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -3,7 +3,7 @@ following Free and Open Source software: Name Version License(s) ---- ------- ---------- - the Go language standard library ("std") v1.20.6 3-clause BSD license + the Go language standard library ("std") v1.20.7 3-clause BSD license github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 MIT license github.com/BurntSushi/toml v1.1.0 MIT license github.com/MakeNowJust/heredoc v1.0.0 MIT license diff --git a/Makefile b/Makefile index 8073c32..77a19ce 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ format: $(tools/golangci-lint) ## (QA) Automatically fix linter complaints $(tools/golangci-lint) run --fix --timeout 2m ./... || true lint: $(tools/golangci-lint) ## (QA) Run the linter - $(tools/golangci-lint) run --timeout 8m ./... + $(tools/golangci-lint) run --timeout 20m ./... .PHONY: protoc @@ -119,13 +119,16 @@ image-tar: image mkdir -p ./build-output docker save $(IMAGE) > ./build-output/ambassador-agent-image.tar -.PHONY: itest -itest: - go test -p 1 ./integration_tests/... +.PHONY: go-integration-test +go-integration-test: + go mod download + go test -parallel 1 ./integration_tests/... -race -.PHONY: unit-test -unit-test: - go test -count=1 ./cmd/... ./pkg/... +.PHONY: go-unit-test +go-unit-test: + go mod download + go test ./cmd/... -race + go test ./pkg/... -race .PHONY: apply apply: push-image