From 6b92a653e291cadccab99754bc62ac1caf5eff5a Mon Sep 17 00:00:00 2001 From: Hayden Roszell Date: Tue, 20 Aug 2024 19:35:52 -0400 Subject: [PATCH] chore(ci): Upgrade to latest go lint Signed-off-by: Hayden Roszell --- .../keyfactor-bootstrap-workflow.yml | 61 +++++++++++++ .github/workflows/test.yml | 85 ------------------- 2 files changed, 61 insertions(+), 85 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/keyfactor-bootstrap-workflow.yml b/.github/workflows/keyfactor-bootstrap-workflow.yml index 64919a4..8cb0094 100644 --- a/.github/workflows/keyfactor-bootstrap-workflow.yml +++ b/.github/workflows/keyfactor-bootstrap-workflow.yml @@ -10,8 +10,69 @@ on: - 'release-*.*' jobs: + build: + name: Build, Lint, and Test + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + # Checkout code + # https://github.com/actions/checkout + - name: Checkout code + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + + # Setup GoLang build environment + # https://github.com/actions/setup-go + - name: Set up Go 1.x + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + with: + go-version-file: 'go.mod' + cache: true + + # Download dependencies + - run: go mod download + + # Build Go binary + - run: go build -v . + + # Run Go linters + # https://github.com/golangci/golangci-lint-action + - name: Run linters + uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 + with: + version: latest + + # Run Go tests + - name: Run go test + run: go test -v ./... + + integrationtest: + name: Integration Test + needs: build + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + # Checkout code + # https://github.com/actions/checkout + - name: Checkout code + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + + # Create a single-node K8s cluster with Kind + # Then, deploy an ephemeral EJBCA and SignServer + - uses: m8rmclaren/ejbca-signserver-k8s@main + with: + deploy-k8s: 'true' + deploy-nginx-ingress: 'true' + deploy-signserver: 'false' + + # Run integration test + - name: Run integration test + run: | + chmod +x test/integrationtest.sh + ./test/integrationtest.sh + call-starter-workflow: uses: keyfactor/actions/.github/workflows/starter.yml@v3 + needs: integrationtest secrets: token: ${{ secrets.V2BUILDTOKEN}} APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 1abbc7e..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: test -on: [workflow_dispatch, push, pull_request] -jobs: - build: - name: Build and Lint - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - # Checkout code - # https://github.com/actions/checkout - - name: Checkout code - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Setup GoLang build environment - # https://github.com/actions/setup-go - - name: Set up Go 1.x - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 - with: - go-version-file: 'go.mod' - cache: true - - # Download dependencies - - run: go mod download - - # Build Go binary - - run: go build -v . - - # Run Go linters - # https://github.com/golangci/golangci-lint-action - - name: Run linters - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 - with: - version: latest - - test: - name: Go Test - needs: build - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - # Checkout code - # https://github.com/actions/checkout - - name: Checkout code - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Setup GoLang build environment - # https://github.com/actions/setup-go - - name: Set up Go 1.x - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 - with: - go-version-file: 'go.mod' - cache: true - - # Download dependencies - - run: go mod download - - # Run Go tests - - name: Run go test - run: go test -v ./... - - integrationtest: - name: Integration Test - needs: test - runs-on: ubuntu-latest - timeout-minutes: 20 - steps: - # Checkout code - # https://github.com/actions/checkout - - name: Checkout code - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - - # Create a single-node K8s cluster with Kind - # Then, deploy an ephemeral EJBCA and SignServer - - uses: m8rmclaren/ejbca-signserver-k8s@main - with: - deploy-k8s: 'true' - deploy-nginx-ingress: 'true' - deploy-signserver: 'false' - - # Run integration test - - name: Run integration test - run: | - chmod +x test/integrationtest.sh - ./test/integrationtest.sh -