DCGM snap tests #42
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 is centrally managed as a template file in https://github.com/canonical/solutions-engineering-automation | |
# To update the file: | |
# - Edit it in the canonical/solutions-engineering-automation repository. | |
# - Open a PR with the changes. | |
# - When the PR merges, the soleng-terraform bot will open a PR to the target repositories with the changes. | |
name: Tests | |
on: | |
workflow_call: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: [main] | |
paths-ignore: | |
- "**.md" | |
- "**.rst" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Complete git history is required to generate the version from git tags. | |
- name: Setup Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y yamllint | |
pipx install tox | |
- name: Lint yaml files | |
run: yamllint .yamllint snap/snapcraft.yaml | |
- name: Lint tests | |
run: tox -e lint | |
build: | |
needs: | |
- lint | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Complete git history is required to generate the version from git tags. | |
- name: Verify snap builds successfully | |
uses: snapcore/action-build@v1 | |
- name: Upload the built snap | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SNAP_FILE | |
path: dcgm*.snap | |
func: | |
needs: | |
- build | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download the built snap | |
uses: actions/download-artifact@v4 | |
with: | |
name: SNAP_FILE | |
- name: Setup Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: pipx install tox | |
- name: Run tests | |
run: tox -e func |