fix: switch CI from rust runner to docker runner with rust:1-bookworm
Old 'rust' runner had stale glibc causing linker failures. Now uses 'docker' runner (same as other repos) with explicit rust:1-bookworm container image (modern glibc). Added cargo cache step for faster builds.
This commit is contained in:
@@ -13,31 +13,40 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: rust
|
runs-on: docker
|
||||||
|
container: rust:1-bookworm
|
||||||
steps:
|
steps:
|
||||||
- name: Clone repo
|
- name: Install node (required by JS-based actions)
|
||||||
run: |
|
run: apt-get update && apt-get install -y --no-install-recommends nodejs
|
||||||
git clone --depth 1 --branch ${{ github.ref_name }} \
|
|
||||||
${{ github.server_url }}/${{ github.repository }}.git .
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache cargo
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
cargo-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --all
|
run: cargo test --all
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build and push image
|
name: Build and push image
|
||||||
runs-on: golang
|
runs-on: docker
|
||||||
needs: test
|
needs: test
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
container:
|
container: docker:27-cli
|
||||||
image: docker:27-cli
|
|
||||||
volumes:
|
|
||||||
- /docker-certs/client:/docker-certs/client:ro
|
|
||||||
env:
|
env:
|
||||||
DOCKER_HOST: tcp://localhost:2376
|
DOCKER_HOST: tcp://forgejo-runner-dind.cicd.svc.cluster.local:2376
|
||||||
DOCKER_TLS_VERIFY: "1"
|
DOCKER_TLS_VERIFY: "1"
|
||||||
DOCKER_CERT_PATH: /docker-certs/client
|
DOCKER_CERT_PATH: /docker-certs/client
|
||||||
steps:
|
steps:
|
||||||
- name: install node (required by JS-based actions)
|
- name: Install node (required by JS-based actions)
|
||||||
run: apk add --no-cache nodejs git
|
run: apk add --no-cache nodejs git
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|||||||
Reference in New Issue
Block a user