Skip to content

Run e2e tests on AL2023 (with SELinux) and Ubuntu 20.04 as well #497

Run e2e tests on AL2023 (with SELinux) and Ubuntu 20.04 as well

Run e2e tests on AL2023 (with SELinux) and Ubuntu 20.04 as well #497

Workflow file for this run

name: Unit tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Check style
run: make check_style
- name: Install Go Test Coverage
run: make install-go-test-coverage
- name: Build
run: make bin
- name: Test
# Run tests as root as we require it for systemd tests
run: sudo make test
- name: Check test coverage
uses: vladopajic/go-test-coverage@v2
id: go-test-coverage
with:
config: ./.testcoverage.yml
- name: Upload report
uses: actions/upload-artifact@v4
id: uploaded-report
with:
name: cover
path: cover.html
- name: Comment test coverage
if: ${{ github.event_name == 'pull_request' }}
env:
TOTAL_COVERAGE: ${{ steps.go-test-coverage.outputs.total-coverage }}
ARTIFACT_URL: ${{ steps.uploaded-report.outputs.artifact-url }}
run: |
echo "### Total test coverage: ${{ env.TOTAL_COVERAGE }}%" >> $GITHUB_STEP_SUMMARY
echo "Download report: ${{ env.ARTIFACT_URL }}" >> $GITHUB_STEP_SUMMARY