CI #108
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: Get testnode info | |
| run: sleep 10 && podman inspect testnode_0 | |
| - name: Check ssh cm | |
| if: success() || failure() | |
| run: podman exec teuthology ssh -oBatchMode=yes -v "cm@$(podman inspect --format '{{ slice .ID 0 12 }}' testnode_0)" whoami | |
| - name: Check ssh ubuntu | |
| if: success() || failure() | |
| run: podman exec teuthology ssh -oBatchMode=yes -v "ubuntu@$(podman inspect --format '{{ slice .ID 0 12 }}' testnode_0)" whoami | |
| - name: Check root | |
| if: success() || failure() | |
| run: podman exec teuthology ssh -oBatchMode=yes -v "root@$(podman inspect --format '{{ slice .ID 0 12 }}' testnode_0)" whoami | |
| - name: Check ssh more | |
| if: success() || failure() | |
| run: podman exec teuthology ssh -oBatchMode=yes -v "cm@$(podman inspect --format '{{ slice .ID 0 12 }}' testnode_0)" bash -c 'echo hello; hostname; uname -a; whoami' | |
| - name: Get testnode logs | |
| if: success() || failure() | |
| run: podman logs testnode_0 | |
| - name: Get testnode journal | |
| if: success() || failure() | |
| run: podman exec testnode_0 journalctl -e | |
| - 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 |