DO NOT MERGE test dpw fix-snap-architectures #36
Workflow file for this run
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
# Copyright 2024 Canonical Ltd. | |
# See LICENSE file for licensing details. | |
name: Tests | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install tox | |
run: pipx install tox | |
- name: Run linters | |
run: tox run -e lint | |
check-version: | |
name: Check version | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install yq | |
run: sudo snap install yq | |
- name: Compare versions | |
run: | | |
SNAP_VERSION=$(yq .version snap/snapcraft.yaml) | |
sudo apt-get update | |
APT_VERSION=$(apt-cache show mysql-server-8.0 | awk '/Version: /{print $2; exit}') | |
APT_VERSION=${APT_VERSION::-17} | |
if [ "$SNAP_VERSION" != "$APT_VERSION" ]; then | |
echo "VERSION MISMATCH DETECTED" | |
echo "Snap version: $SNAP_VERSION" | |
echo "APT version: $APT_VERSION" | |
exit 1 | |
fi | |
build: | |
name: Build snap | |
uses: canonical/data-platform-workflows/.github/workflows/build_snap.yaml@fix-snap-architectures | |
smoke: | |
name: Smoke test snap | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
needs: | |
- lint | |
- check-version | |
- build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install tox | |
run: pipx install tox | |
- name: Download snap package(s) | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: ${{ needs.build.outputs.artifact-prefix }}-* | |
merge-multiple: true | |
- name: Run tests | |
run: tox run -e smoke | |
audit-log-plugin: | |
name: Audit log plugin test | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
needs: | |
- lint | |
- check-version | |
- build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install tox | |
run: pipx install tox | |
- name: Download snap package(s) | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: ${{ needs.build.outputs.artifact-prefix }}-* | |
merge-multiple: true | |
- name: Run tests | |
run: tox run -e audit_log |