ci: run checks in ci pipeline #68
Workflow file for this run
This file contains hidden or 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
| name: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| name: Check code style | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Install precommit | |
| run: pip install pre-commit | |
| - name: Check lint | |
| run: pre-commit run ruff-check --all-files | |
| - name: Check format | |
| run: pre-commit run ruff-format --all-files | |
| test: | |
| name: CI on python${{ matrix.python }} via ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| needs: lint | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| python: "3.12" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Install packages | |
| run: sudo apt install podman golang-github-containernetworking-plugin-dnsname sqlite3 jq | |
| - name: Create virtualenv | |
| run: python3 -m venv venv | |
| - name: Install | |
| run: ./venv/bin/pip3 install -e . | |
| - name: Set owner for /dev/loop-control | |
| run: sudo chown $(whoami) /dev/loop-control | |
| - name: Configure | |
| run: ./venv/bin/ceph-devstack config set containers.postgres.count 0 | |
| - name: Doctor | |
| run: ./venv/bin/ceph-devstack -v doctor --fix | |
| - name: Build | |
| run: ./venv/bin/ceph-devstack -v build | |
| - name: Create | |
| run: ./venv/bin/ceph-devstack -v create | |
| - name: Start | |
| run: ./venv/bin/ceph-devstack -v start | |
| - name: Check Status | |
| run: podman ps -a | |
| - name: Wait | |
| run: ./venv/bin/ceph-devstack wait teuthology | |
| - name: Dump logs | |
| if: success() || failure() | |
| run: podman logs -f teuthology | |
| - name: Create archive | |
| if: success() || failure() | |
| run: | | |
| mkdir -p /tmp/artifacts | |
| - name: Dump job data | |
| if: success() || failure() | |
| run: | | |
| podman cp paddles:/paddles/dev.db /tmp/ | |
| sqlite3 /tmp/dev.db ".output stdout" ".mode json" "select * from jobs" | jq | tee /tmp/artifacts/jobs.json | |
| - name: Upload jobs.json | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jobs | |
| path: /tmp/artifacts/jobs.json | |
| - name: Create tarball of log archive | |
| if: success() || failure() | |
| run: | | |
| tar -czf /tmp/artifacts/archive.tar ~/.local/share/ceph-devstack/archive/ | |
| - name: Upload log archive | |
| if: success() || failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: archive | |
| path: /tmp/artifacts/archive.tar | |
| - name: Stop | |
| run: ./venv/bin/ceph-devstack -v stop | |
| - name: Remove | |
| run: ./venv/bin/ceph-devstack -v remove |