fix(ci): run checks in an Arch container without sudo
- commit
- 8f0bec442716854cb51256fe0762de1e13b5cf0f
- author
- brice · · 2026-10-13 20:03 UTC
- parent
- 6ec2cf9
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +17 -8
M .github/workflows/ci.yml +17 -8
| @@ -7,20 +7,28 @@ on: | |||
| 7 | 7 | jobs: | |
| 8 | 8 | test: | |
| 9 | 9 | runs-on: ubuntu-latest | |
| 10 | + | container: | |
| 11 | + | image: archlinux:latest | |
| 12 | + | options: --init | |
| 10 | 13 | steps: | |
| 14 | + | - run: pacman -Syu --noconfirm --needed git go make gcc wayland | |
| 11 | 15 | - uses: actions/checkout@v4 | |
| 12 | - | - uses: actions/setup-go@v5 | |
| 13 | - | with: | |
| 14 | - | go-version: '1.27' | |
| 15 | - | - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libwayland-server0 | |
| 16 | + | - run: | | |
| 17 | + | git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| 18 | + | go version | |
| 19 | + | test "$(go env GOVERSION | cut -d. -f1-2)" = go1.27 | |
| 16 | 20 | - run: make check | |
| 17 | 21 | - run: make race | |
| 18 | 22 | ||
| 19 | 23 | bindings: | |
| 20 | 24 | runs-on: ubuntu-latest | |
| 25 | + | container: | |
| 26 | + | image: archlinux:latest | |
| 27 | + | options: --init | |
| 21 | 28 | permissions: | |
| 22 | 29 | contents: read | |
| 23 | 30 | steps: | |
| 31 | + | - run: pacman -Syu --noconfirm --needed git go gcc wayland | |
| 24 | 32 | - uses: actions/checkout@v4 | |
| 25 | 33 | with: | |
| 26 | 34 | path: purego-libwayland | |
| @@ -31,10 +39,11 @@ jobs: | |||
| 31 | 39 | ref: main | |
| 32 | 40 | path: bindings | |
| 33 | 41 | persist-credentials: false | |
| 34 | - | - uses: actions/setup-go@v5 | |
| 35 | - | with: | |
| 36 | - | go-version-file: bindings/go.mod | |
| 37 | - | - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libwayland-server0 | |
| 42 | + | - run: | | |
| 43 | + | git config --global --add safe.directory "$GITHUB_WORKSPACE/purego-libwayland" | |
| 44 | + | git config --global --add safe.directory "$GITHUB_WORKSPACE/bindings" | |
| 45 | + | go version | |
| 46 | + | test "$(go env GOVERSION | cut -d. -f1-2)" = go1.27 | |
| 38 | 47 | - name: Build and test go-wayland-bindings against this checkout | |
| 39 | 48 | working-directory: bindings | |
| 40 | 49 | run: | | |
| @@ -7,20 +7,28 @@ on: | |||||
| 7 | jobs: | 7 | jobs: | ||
| 8 | test: | 8 | test: | ||
| 9 | runs-on: ubuntu-latest | 9 | runs-on: ubuntu-latest | ||
| 10 | + | container: | |||
| 11 | + | image: archlinux:latest | |||
| 12 | + | options: --init | |||
| 10 | steps: | 13 | steps: | ||
| 14 | + | - run: pacman -Syu --noconfirm --needed git go make gcc wayland | |||
| 11 | - uses: actions/checkout@v4 | 15 | - uses: actions/checkout@v4 | ||
| 12 | - | - uses: actions/setup-go@v5 | 16 | + | - run: | |
| 13 | - | with: | 17 | + | git config --global --add safe.directory "$GITHUB_WORKSPACE" |
| 14 | - | go-version: '1.27' | 18 | + | go version |
| 15 | - | - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libwayland-server0 | 19 | + | test "$(go env GOVERSION | cut -d. -f1-2)" = go1.27 |
| 16 | - run: make check | 20 | - run: make check | ||
| 17 | - run: make race | 21 | - run: make race | ||
| 18 | 22 | ||||
| 19 | bindings: | 23 | bindings: | ||
| 20 | runs-on: ubuntu-latest | 24 | runs-on: ubuntu-latest | ||
| 25 | + | container: | |||
| 26 | + | image: archlinux:latest | |||
| 27 | + | options: --init | |||
| 21 | permissions: | 28 | permissions: | ||
| 22 | contents: read | 29 | contents: read | ||
| 23 | steps: | 30 | steps: | ||
| 31 | + | - run: pacman -Syu --noconfirm --needed git go gcc wayland | |||
| 24 | - uses: actions/checkout@v4 | 32 | - uses: actions/checkout@v4 | ||
| 25 | with: | 33 | with: | ||
| 26 | path: purego-libwayland | 34 | path: purego-libwayland | ||
| @@ -31,10 +39,11 @@ jobs: | |||||
| 31 | ref: main | 39 | ref: main | ||
| 32 | path: bindings | 40 | path: bindings | ||
| 33 | persist-credentials: false | 41 | persist-credentials: false | ||
| 34 | - | - uses: actions/setup-go@v5 | 42 | + | - run: | |
| 35 | - | with: | 43 | + | git config --global --add safe.directory "$GITHUB_WORKSPACE/purego-libwayland" |
| 36 | - | go-version-file: bindings/go.mod | 44 | + | git config --global --add safe.directory "$GITHUB_WORKSPACE/bindings" |
| 37 | - | - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libwayland-server0 | 45 | + | go version |
| 46 | + | test "$(go env GOVERSION | cut -d. -f1-2)" = go1.27 | |||
| 38 | - name: Build and test go-wayland-bindings against this checkout | 47 | - name: Build and test go-wayland-bindings against this checkout | ||
| 39 | working-directory: bindings | 48 | working-directory: bindings | ||
| 40 | run: | | 49 | run: | | ||