Skip to content

Commit

Permalink
Merge nightly test and cron job
Browse files Browse the repository at this point in the history
The nightly job is also a cron job that executes daily, so it
makes sense to merge those two workflows.
  • Loading branch information
petrutlucian94 committed Dec 13, 2024
1 parent 5f09817 commit b6024c7
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 90 deletions.
89 changes: 0 additions & 89 deletions .github/workflows/cron-jobs.yaml

This file was deleted.

78 changes: 77 additions & 1 deletion .github/workflows/nightly-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Nightly Latest/Edge Tests
name: Nightly Tests

on:
schedule:
Expand All @@ -7,6 +7,7 @@ on:
paths:
- .github/workflows/nightly-test.yaml
- .github/workflows/e2e-tests.yaml
- .github/workflows/security-scan.yaml

permissions:
contents: read
Expand All @@ -26,3 +27,78 @@ jobs:
os: ${{ matrix.os }}
channel: ${{ matrix.channel }}
test-tags: 'up_to_weekly'

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
- { branch: release-1.30, channel: 1.30-classic/edge }
- { branch: release-1.31, channel: 1.31-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: "1.22"
- name: go mod download
working-directory: src/k8s
run: go mod download
- name: TICS scan
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/

0 comments on commit b6024c7

Please sign in to comment.