1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
name: Tests
on:
- push
- pull_request
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-tests:
name: Code tests
strategy:
fail-fast: false
matrix:
go:
- oldstable
- stable
os:
- ubuntu-22.04
- ubuntu-24.04
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Dependency Review
uses: actions/dependency-review-action@v4
if: github.event_name == 'pull_request'
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Install dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y \
pipx \
squashfs-tools
# With pipx >= 1.5.0, we could use pipx --global instead.
PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin \
pipx install codespell
- name: Update Go modules
run: make update-gomod
- name: Run static analysis
run: make static-analysis
- name: Unit tests (all)
run: make check
documentation:
name: Documentation tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get install aspell aspell-en
sudo snap install mdl
- name: Run markdown linter
run: |
make doc-lint
- name: Run spell checker
run: |
make doc-spellcheck
- name: Run inclusive naming checker
uses: get-woke/woke-action@v0
with:
fail-on-error: true
woke-args: "*.md **/*.md -c https://github.com/canonical-web-and-design/Inclusive-naming/raw/main/config.yml"
- name: Run link checker
# This can fail intermittently due to external resources being unavailable.
continue-on-error: true
run: |
make doc-linkcheck
|