Nightly Tests #364
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Tests | |
on: | |
schedule: | |
- cron: "0 0 * * *" # Runs every midnight | |
pull_request: | |
paths: | |
- .github/workflows/nightly-test.yaml | |
- .github/workflows/e2e-tests.yaml | |
- .github/workflows/security-scan.yaml | |
permissions: | |
contents: read | |
jobs: | |
test-integration: | |
name: Integration Test ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.release }} | |
strategy: | |
matrix: | |
os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04"] | |
arch: ["amd64", "arm64"] | |
channel: ["latest/edge"] | |
fail-fast: false # TODO: remove once we no longer have flaky tests. | |
uses: ./.github/workflows/e2e-tests.yaml | |
with: | |
arch: ${{ matrix.arch }} | |
os: ${{ matrix.os }} | |
channel: ${{ matrix.channel }} | |
test-tags: 'up_to_nightly' | |
Trivy: | |
permissions: | |
contents: read # for actions/checkout to fetch code | |
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | |
strategy: | |
matrix: | |
include: | |
# Latest branches | |
- { branch: main, channel: latest/edge } | |
# Stable branches | |
# Add branches to test here | |
# TODO: automatically retrieve the list of channels. | |
- { branch: release-1.30, channel: 1.30-classic/edge } | |
- { branch: release-1.31, channel: 1.31-classic/edge } | |
- { branch: release-1.32, channel: 1.32-classic/edge } | |
uses: ./.github/workflows/security-scan.yaml | |
with: | |
channel: ${{ matrix.channel }} | |
checkout-ref: ${{ matrix.branch }} | |
TICS: | |
permissions: | |
contents: read | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
# Latest branches | |
- { branch: main } | |
steps: | |
- name: Checking out repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{matrix.branch}} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: './src/k8s/go.mod' | |
- name: go mod download | |
working-directory: src/k8s | |
run: go mod download | |
- name: TICS scan | |
# TODO: move the following to a script. | |
run: | | |
export TICSAUTHTOKEN=${{ secrets.TICSAUTHTOKEN }} | |
set -x | |
# Install python dependencies | |
pip install -r tests/integration/requirements-test.txt | |
pip install -r tests/integration/requirements-dev.txt | |
cd src/k8s | |
# TICS requires us to have the test results in cobertura xml format under the | |
# directory use below | |
sudo make go.unit | |
go install github.com/boumenot/gocover-cobertura@latest | |
gocover-cobertura < coverage.txt > coverage.xml | |
mkdir .coverage | |
mv ./coverage.xml ./.coverage/ | |
# Install the TICS and staticcheck | |
go install honnef.co/go/tools/cmd/[email protected] | |
. <(curl --silent --show-error 'https://canonical.tiobe.com/tiobeweb/TICS/api/public/v1/fapi/installtics/Script?cfg=default&platform=linux&url=https://canonical.tiobe.com/tiobeweb/TICS/') | |
# We need to have our project built | |
# We load the dqlite libs here instead of doing through make because TICS | |
# will try to build parts of the project itself | |
sudo add-apt-repository -y ppa:dqlite/dev | |
sudo apt install dqlite-tools-v2 libdqlite1.17-dev | |
sudo make clean | |
go build -a ./... | |
TICSQServer -project k8s-snap -tmpdir /tmp/tics -branchdir $HOME/work/k8s-snap/k8s-snap/ |