Address low-complexity issues #42
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] | |
| tags: ["v*"] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| BINK_VERSION: v0.1.1 | |
| concurrency: | |
| group: ci-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Unit tests | |
| run: make unit | |
| - name: Vet | |
| run: make vet | |
| - name: Lint | |
| run: make lint | |
| e2e: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| IMAGE: ghcr.io/${{ github.repository }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Download bink release | |
| run: | | |
| sudo curl -fsSL -o /usr/local/bin/bink \ | |
| https://github.com/alicefr/bink/releases/download/${{ env.BINK_VERSION }}/bink | |
| sudo chmod +x /usr/local/bin/bink | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Set up KVM | |
| run: sudo chmod 666 /dev/kvm | |
| - name: Configure kernel | |
| run: | | |
| # Unload AppArmor profiles — the passt profile blocks remount | |
| # operations needed for passt's self-sandboxing inside containers. | |
| sudo aa-teardown 2>/dev/null || true | |
| # Allow unprivileged user namespace creation (needed by passt | |
| # inside containers). | |
| sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
| - name: Enable KSM | |
| run: | | |
| sudo sh -c 'echo 1 > /sys/kernel/mm/ksm/run' | |
| sudo sh -c 'echo 5000 > /sys/kernel/mm/ksm/pages_to_scan' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y podman | |
| - name: Start podman socket | |
| run: systemctl --user start podman.socket | |
| - name: Run e2e tests | |
| run: make buildimg deploy-bink e2e V=1 | |
| - name: Push to GHCR | |
| if: github.event_name == 'push' | |
| run: | | |
| podman login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io | |
| podman push bootc-operator:dev ${{ env.IMAGE }}:dev | |
| podman push bootc-operator:dev ${{ env.IMAGE }}:${{ github.sha }} | |
| if [[ "${{ github.ref }}" == refs/tags/v* ]]; then | |
| podman push bootc-operator:dev ${{ env.IMAGE }}:${{ github.ref_name }} | |
| fi | |
| if [[ "${{ github.ref }}" == refs/heads/main ]]; then | |
| podman push bootc-operator:dev ${{ env.IMAGE }}:latest | |
| fi |