Skip to content

Commit

Permalink
Move smoketest into functional.yaml
Browse files Browse the repository at this point in the history
This enabled us to verify the helm chart and smoketests on each PR rather
than having to wait until it is merged.
  • Loading branch information
nichtsfrei committed Feb 12, 2025
1 parent 9a5436e commit 2b4ba0f
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/functional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,57 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/compile-x86_64

smoketest:
runs-on: ubuntu-latest
steps:
- name: Start a local k8s cluster
uses: jupyterhub/action-k3s-helm@v4
with:
k3s-channel: latest
metrics-enabled: false
# maybe easier to use the docker daemon?
- uses: actions/checkout@v4
- name: publish current docker image into k3s
run: |
docker build -t openvas:latest -f .docker/prod.Dockerfile .
docker save -o /tmp/openvas.tar openvas:latest
sudo k3s ctr images import /tmp/openvas.tar
- name: 'Set openvas-scanner-image'
run: |
echo "openvas:" >> st.yaml
echo " repository: openvas" >> st.yaml
echo " pullPolicy: Never" >> st.yaml
echo " tag: \"latest\"" >> st.yaml
cat st.yaml
- name: Start a local k8s cluster
uses: jupyterhub/action-k3s-helm@v4
with:
k3s-channel: latest
metrics-enabled: false
- name: deploy openvasd
run: |
cd rust/examples/tls/self-signed
make delete deploy
cd -
helm uninstall openvasd --namespace openvasd|| true
helm install --namespace openvasd --create-namespace openvasd charts/openvasd/ --values charts/openvasd/values.yaml --values charts/openvasd/mtls-wo-ingress.yaml --values st.yaml
kubectl rollout status --watch --timeout 600s deployment/openvasd --namespace openvasd
echo "OPENVASD_SERVER=https://$(kubectl get svc -n openvasd | awk 'FNR == 2 {print $(3)}')" >> $GITHUB_ENV
- name: smoketest
working-directory: rust/crates/smoketest
env:
SCAN_CONFIG: configs/simple_scan_ssh_only.json
CLIENT_KEY: ../../../examples/tls/self-signed/client.rsa
CLIENT_CERT: ../../../examples/tls/self-signed/client.pem
run: |
make build run
# - uses: actions/cache@v4
# with:
# path: /tmp/openvas.tar
# key: openvas-cache-${{ github.run_id }}
tests:
runs-on: ubuntu-latest
needs: [build-rs]
Expand Down

0 comments on commit 2b4ba0f

Please sign in to comment.