Skip to content

Commit

Permalink
test: call venom tests in github-action CI
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Henri Symoneaux <[email protected]>
  • Loading branch information
phsym committed Nov 18, 2024
1 parent 298e2f6 commit adc7c8b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: test

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_call: {}


jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-build-env
- run: go build -cover ./cmd/okms
- name: Setup Venom
run: |
wget https://github.com/ovh/venom/releases/download/v1.2.0/venom.linux-amd64
mv venom.linux-amd64 venom
chmod +x venom
- run: |
echo "${{secrets.CERTIFICATE}}" > tls.crt
echo "${{secrets.PRIVATE_KEY}}" > tls.key
cat > okms.yaml <<-EOF
version: 1
profile: default
profiles:
default: # default profile
http:
endpoint: ${{secrets.KMS_HTTP_ENDPOINT}}
auth:
type: mtls
cert: $(pwd)/tls.crt
key: $(pwd)/tls.key
EOF
- run: ./okms keys ls -d -c okms.yaml
continue-on-error: true
- name: Execute tests
run: make -C tests
- uses: actions/upload-artifact@v4
with:
name: test_results
path: |
./tests/out/test_results.html
./tests/out/venom.log
retention-days: 5
if: always()

6 changes: 6 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
test:
rm -Rf out
../venom run --html-report --output-dir=out --var-from-file cfg/vars.yaml -v .
go tool covdata percent -i out/coverage
go tool covdata textfmt -i out/coverage -o out/coverage.txt
go tool cover -html out/coverage.txt -o out/coverage.html

0 comments on commit adc7c8b

Please sign in to comment.