Skip to content

Commit

Permalink
touch up ci workflows a bit
Browse files Browse the repository at this point in the history
Signed-off-by: AliceProxy <[email protected]>
  • Loading branch information
AliceProxy committed Aug 15, 2023
1 parent 2ca1813 commit 9ce1851
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 39 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
types:
- labeled
jobs:
build_image:
build-image:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'ok to test' }}
steps:
Expand All @@ -30,9 +30,9 @@ jobs:
with:
name: image
path: build-output/ambassador-agent-image.tar
test:
go-integration-tests:
runs-on: ubuntu-latest
needs: build_image
needs: build-image
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
export KUBECONFIG=${{ steps.kluster.outputs.kubeconfig }}
export AMBASSADOR_AGENT_DOCKER_IMAGE=datawiredev/ambassador-agent:dev-latest
export KAT_SERVER_DOCKER_IMAGE=docker.io/datawiredev/kat-server:3.0.1-0.20220817135951-2cb28ef4f415
make itest
make go-integration-test
- name: Mark test as succesfull
run: echo "::set-output name=run_result::success" > run_result
- name: Cleanup kluster
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/licenses.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: "License verification"
on:
pull_request:

env:
GO_VERSION: 1.19.5

jobs:
dependency_info_linux:
name: "Verify use of forbidden licenses"
Expand All @@ -15,7 +19,7 @@ jobs:
ref: "${{ github.event.pull_request.head.sha }}"
- uses: actions/setup-go@v3
with:
go-version: 1.19.5
go-version: "${{env.GO_VERSION}}"
- name: "Generate dependency information"
shell: bash
run: make generate
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/test_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Test and Lint"

on:
pull_request:
branches:
- "**"

env:
GO_VERSION: 1.19.5

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:
needs: lint
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
- name: Report Success
run: echo "::set-output name=run_result::success" > run_result
26 changes: 0 additions & 26 deletions .github/workflows/unit_tests.yaml

This file was deleted.

19 changes: 11 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ build:

.PHONY: format
format: $(tools/golangci-lint) ## (QA) Automatically fix linter complaints
$(tools/golangci-lint) run --fix --timeout 2m ./... || true
$(tools/golangci-lint) run -v --fix --timeout 2m ./... || true

lint: $(tools/golangci-lint) ## (QA) Run the linter
$(tools/golangci-lint) run --timeout 8m ./...
$(tools/golangci-lint) run -v --timeout 8m ./...


.PHONY: protoc
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9ce1851

Please sign in to comment.