Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add moonray integration tests CI #475

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/moonray-integration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Integration Tests (Moonray)

on:
push:
branches:
- main
- 'autoupdate/sync/**'
pull_request:

permissions:
contents: read

jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- name: Checking out repo
uses: actions/checkout@v4
- name: Install lxd
run: |
sudo lxd init --auto
sudo usermod --append --groups lxd $USER
sg lxd -c 'lxc version'
- name: Install snapcraft
run: |
sudo snap install snapcraft --classic
- name: Apply moonray patch
run: |
./build-scripts/patches/moonray/apply
- name: Build snap
run: |
sg lxd -c 'snapcraft --use-lxd'
mv k8s_*.snap k8s-moonray.snap
- name: Uploading snap
uses: actions/upload-artifact@v4
with:
name: k8s-moonray.snap
path: k8s-moonray.snap

test-integration:
needs: [ build ]
name: Test ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu:20.04"]
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install tox
run: pip install tox
- name: Install lxd
run: |
sudo snap refresh lxd --channel 5.19/stable
sudo lxd init --auto
sudo usermod --append --groups lxd $USER
sg lxd -c 'lxc version'
- name: Download snap
uses: actions/download-artifact@v4
with:
name: k8s-moonray.snap
path: build
- name: Run end to end tests
run: |
export TEST_SNAP="$PWD/build/k8s-moonray.snap"
export TEST_SUBSTRATE=lxd
export TEST_LXD_IMAGE=${{ matrix.os }}
cd tests/integration && sg lxd -c 'tox -e integration'
Loading