Makefile: add pkg-sanity-check-prepare for archlinux #58
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: | |
| push: | |
| branches: [main, master] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| stylecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: pip install black flake8 tuxpkg | |
| - name: Run stylecheck | |
| run: make stylecheck | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| pip install -e . | |
| pip install -r requirements-dev.txt | |
| - name: Run typecheck | |
| run: make typecheck | |
| spellcheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: pip install codespell tuxpkg | |
| - name: Run spellcheck | |
| run: make spellcheck | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install -e . | |
| pip install -r requirements-dev.txt | |
| - name: Run tests | |
| run: make test | |
| unit-tests-arm64: | |
| runs-on: ubuntu-24.04-arm | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install -e . | |
| pip install -r requirements-dev.txt | |
| - name: Run tests | |
| run: make test | |
| integration-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - device: qemu-arm64 | |
| test: ltp-smoke | |
| - device: qemu-x86_64 | |
| test: ltp-smoke | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| # Workaround: https://tuxrun.org/troubleshooting/#failure-on-ubuntu | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libguestfs-tools qemu-system | |
| sudo chmod 644 /boot/vmlinuz* | |
| - name: Install dependencies | |
| run: pip install -e . | |
| - name: Run integration tests | |
| run: python3 test/integration.py --device ${{ matrix.device }} --tests ${{ matrix.test }} --runtime podman | |
| ci-image-debian: | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for Dockerfile changes | |
| id: check | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| elif git diff --name-only ${{ github.event.before }}..${{ github.event.after }} | grep -q 'Dockerfile.ci-debian'; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Log in to Container Registry | |
| if: steps.check.outputs.changed == 'true' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Debian image | |
| if: steps.check.outputs.changed == 'true' | |
| run: | | |
| docker build -t ${{ env.REGISTRY }}/${{ github.repository }}:ci-debian -f Dockerfile.ci-debian . | |
| docker push ${{ env.REGISTRY }}/${{ github.repository }}:ci-debian | |
| ci-image-fedora: | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for Dockerfile changes | |
| id: check | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| elif git diff --name-only ${{ github.event.before }}..${{ github.event.after }} | grep -q 'Dockerfile.ci-fedora'; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Log in to Container Registry | |
| if: steps.check.outputs.changed == 'true' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Fedora image | |
| if: steps.check.outputs.changed == 'true' | |
| run: | | |
| docker build -t ${{ env.REGISTRY }}/${{ github.repository }}:ci-fedora -f Dockerfile.ci-fedora . | |
| docker push ${{ env.REGISTRY }}/${{ github.repository }}:ci-fedora | |
| ci-image-archlinux: | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for Dockerfile changes | |
| id: check | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| elif git diff --name-only ${{ github.event.before }}..${{ github.event.after }} | grep -q 'Dockerfile.ci-archlinux'; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Log in to Container Registry | |
| if: steps.check.outputs.changed == 'true' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Arch Linux image | |
| if: steps.check.outputs.changed == 'true' | |
| run: | | |
| docker build -t ${{ env.REGISTRY }}/${{ github.repository }}:ci-archlinux -f Dockerfile.ci-archlinux . | |
| docker push ${{ env.REGISTRY }}/${{ github.repository }}:ci-archlinux | |
| tuxpkg: | |
| needs: [ci-image-debian, ci-image-fedora, ci-image-archlinux] | |
| if: ${{ !failure() && !cancelled() }} | |
| uses: Linaro/tuxpkg/.github/workflows/tuxpkg.yml@main | |
| with: | |
| tuxpkg_project: tuxrun | |
| ci_image_debian: ghcr.io/${{ github.repository }}:ci-debian | |
| ci_image_fedora: ghcr.io/${{ github.repository }}:ci-fedora | |
| ci_image_archlinux: ghcr.io/${{ github.repository }}:ci-archlinux | |
| secrets: | |
| TUXPKG_RELEASE_KEY: ${{ secrets.TUXPKG_RELEASE_KEY }} | |
| TUXPKG_RELEASE_KEYID: ${{ secrets.TUXPKG_RELEASE_KEYID }} | |
| FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }} | |
| build-wheel: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install flit | |
| run: pip install flit | |
| - name: Build wheel | |
| run: flit build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel | |
| path: dist/*.whl | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: pip install mkdocs-material tuxpkg | |
| - name: Build docs | |
| run: make doc | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs | |
| path: public | |
| pages: | |
| runs-on: ubuntu-latest | |
| needs: [docs, tuxpkg] | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: docs | |
| path: public | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: repository | |
| path: public/packages | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: public | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |