fix(ci): simplify workflow to avoid external GitHub actions
The previous workflow was getting stuck because it was trying to pull actions from GitHub (https://github.com/actions/cache@v3) which can cause connectivity and compatibility issues in Forgejo. Changes: - Remove all external GitHub action dependencies except checkout - Use Forgejo's built-in checkout@v4 action - Remove caching steps (can be added later with Forgejo-native actions) - Add explicit dependency installation step - Use 'cargo build --release' for better optimization This should make the CI more reliable and faster to start.
This commit is contained in:
parent
dae4d680bb
commit
856f86e72d
1 changed files with 10 additions and 38 deletions
|
|
@ -22,25 +22,11 @@ jobs:
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache cargo registry
|
- name: Install dependencies
|
||||||
uses: https://github.com/actions/cache@v3
|
run: |
|
||||||
with:
|
apt-get update && apt-get install -y pkg-config libssl-dev
|
||||||
path: ~/.cargo/registry
|
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Cache cargo index
|
|
||||||
uses: https://github.com/actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/.cargo/git
|
|
||||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Cache cargo build
|
|
||||||
uses: https://github.com/actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: backend/target
|
|
||||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Run rustfmt
|
- name: Run rustfmt
|
||||||
working-directory: ./backend
|
working-directory: ./backend
|
||||||
|
|
@ -60,30 +46,16 @@ jobs:
|
||||||
needs: lint
|
needs: lint
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache cargo registry
|
- name: Install dependencies
|
||||||
uses: https://github.com/actions/cache@v3
|
run: |
|
||||||
with:
|
apt-get update && apt-get install -y pkg-config libssl-dev
|
||||||
path: ~/.cargo/registry
|
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Cache cargo index
|
|
||||||
uses: https://github.com/actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ~/.cargo/git
|
|
||||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Cache cargo build
|
|
||||||
uses: https://github.com/actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: backend/target
|
|
||||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
working-directory: ./backend
|
working-directory: ./backend
|
||||||
run: |
|
run: |
|
||||||
cargo build --verbose
|
cargo build --release --verbose
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
working-directory: ./backend
|
working-directory: ./backend
|
||||||
|
|
@ -101,7 +73,7 @@ jobs:
|
||||||
image: docker:dind
|
image: docker:dind
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: https://github.com/actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
working-directory: ./backend
|
working-directory: ./backend
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue