Skip to content

✨ Upgrade to CAPI 1.5 #740

✨ Upgrade to CAPI 1.5

✨ Upgrade to CAPI 1.5 #740

Workflow file for this run

name: Test Code
# yamllint disable rule:line-length
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
- "releases/**"
paths:
- "**.go"
- "**go.mod"
- "**go.sum"
- ".github/workflows/**"
- "Makefile"
- "images/builder/**"
- "images/caph/**"
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true
jobs:
test:
name: Test Code
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Coverage result name
id: name
run: |
if [ ${{ github.event.pull_request }} ]; then
NAME=pr-${{ github.event.pull_request.number }}
else
NAME=${{ github.sha }}
fi
echo name=${NAME} >> $GITHUB_OUTPUT
- name: Install go
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: "go.mod"
- name: Install dependencies
run: make gotestsum go-cover-treemap setup-envtest
- name: Install go modules for test
shell: bash
run: |
cd test && GO111MODULE=on GOPROXY=https://proxy.golang.org go mod download
- name: Running tests
run: make test-unit
- name: Create Report
run: make report-cover-html report-cover-treemap
- name: Test Summary
uses: test-summary/action@62bc5c68de2a6a0d02039763b8c754569df99e3f # v2.1
with:
paths: ".coverage/junit.xml"
- name: Upload Report
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: reports-${{ steps.name.outputs.name }}
path: .reports
retention-days: 30