fix(ci): replace GitHub Actions with Forgejo-compatible workflow
The original workflow was using GitHub-specific actions that don't exist in Forgejo, causing CI to fail immediately with: 'repository not found: Not Found' for actions-rs/toolchain@v1 Key changes: - Replace 'runs-on: docker' with 'runs-on: ubuntu-latest' and proper containers - Remove 'actions-rs/toolchain@v1' (doesn't exist in Forgejo) - Use 'rust:latest' container image instead which includes rustfmt, clippy, and cargo - Update all action references to use full URLs (https://github.com/...) - Use 'docker:dind' service for Docker-in-Docker support - Remove 'docker/setup-buildx-action@v3' (not needed for basic docker build) This workflow is now compatible with Forgejo and should run successfully.
This commit is contained in:
parent
ee0feb77ef
commit
dae4d680bb
1 changed files with 21 additions and 30 deletions
|
|
@ -17,33 +17,27 @@ env:
|
|||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: docker
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: rust:latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
components: rustfmt, clippy
|
||||
override: true
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v3
|
||||
uses: https://github.com/actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo index
|
||||
uses: actions/cache@v3
|
||||
uses: https://github.com/actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo/git
|
||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo build
|
||||
uses: actions/cache@v3
|
||||
uses: https://github.com/actions/cache@v3
|
||||
with:
|
||||
path: backend/target
|
||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
|
@ -60,33 +54,28 @@ jobs:
|
|||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: docker
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: rust:latest
|
||||
needs: lint
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v3
|
||||
uses: https://github.com/actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo index
|
||||
uses: actions/cache@v3
|
||||
uses: https://github.com/actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo/git
|
||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo build
|
||||
uses: actions/cache@v3
|
||||
uses: https://github.com/actions/cache@v3
|
||||
with:
|
||||
path: backend/target
|
||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
|
@ -103,14 +92,16 @@ jobs:
|
|||
|
||||
docker-build:
|
||||
name: Docker Build
|
||||
runs-on: docker
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker:latest
|
||||
needs: build
|
||||
services:
|
||||
docker:
|
||||
image: docker:dind
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Build Docker image
|
||||
working-directory: ./backend
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue