-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
83 additions
and
60 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: smoke-tests | ||
|
||
"on": | ||
workflow_call: | ||
inputs: | ||
py_ver: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
smoke-tests: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 5 | ||
strategy: | ||
matrix: | ||
runtime: | ||
- "docker" | ||
- "podman" | ||
# allow podman job to fail, since it started to fail on github actions | ||
continue-on-error: ${{ matrix.runtime == 'podman' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: containerlab | ||
|
||
- name: Move containerlab to usr/bin | ||
run: sudo mv ./containerlab /usr/bin/containerlab && sudo chmod a+x /usr/bin/containerlab | ||
|
||
- name: Setup Podman | ||
if: matrix.runtime == 'podman' | ||
run: | | ||
sudo apt purge -y podman | ||
sudo mkdir -p /etc/apt/keyrings | ||
curl -fsSL "https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key" \ | ||
| gpg --dearmor \ | ||
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ | ||
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ | ||
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | ||
sudo apt-get update -qq | ||
sudo apt-get -qq -y install podman | ||
sudo systemctl start podman | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.py_ver }} | ||
cache: pip | ||
cache-dependency-path: "tests/requirements.txt" | ||
|
||
- name: Install robotframework | ||
run: | | ||
pip install -r tests/requirements.txt | ||
- name: Run smoke tests | ||
run: | | ||
bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/01-smoke | ||
# upload test reports as a zip file | ||
- name: Upload test report | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: 01-smoke-log-${{ matrix.runtime }} | ||
path: ./tests/out/*.html | ||
|
||
# upload coverage report from unit tests, as they are then | ||
# merged with e2e tests coverage | ||
- name: Upload coverage | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: coverage-smoke-tests-${{ matrix.runtime }} | ||
path: /tmp/clab-tests/coverage/* | ||
retention-days: 7 |