Skip to content

Commit a5a5f2f

Browse files
committed
feat: Update GitHub Actions workflow for Rust build
1 parent 1758ad2 commit a5a5f2f

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

.github/workflows/backend.yml

+8-18
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,17 @@ jobs:
4949
apt update \
5050
&& apt install -y curl gcc musl-dev openssl libssl-dev pkg-config cmake
5151
52-
- name: Install Rust
53-
id: rust
54-
run: |
55-
curl -o /usr/local/bin/rustup-init --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh \
56-
&& chmod +x /usr/local/bin/rustup-init \
57-
&& /usr/local/bin/rustup-init --default-toolchain nightly -y \
58-
&& source $HOME/.cargo/env
59-
env:
60-
CARGO_HOME: ${{ github.workspace }}/cargo
61-
62-
- name: Cache Rust dependencies
63-
id: cache-rust
64-
uses: actions/cache@v3
52+
- uses: actions-rs/toolchain@v1
6553
with:
66-
path: ${{ github.workspace }}/cargo
67-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
68-
restore-keys: ${{ runner.os }}-cargo-
54+
toolchain: nightly
6955

70-
- name: Build Rust project
56+
- uses: actions-rs/cargo@v1
57+
with:
58+
command: build
59+
args: --release
60+
- name: Build and Push GitDataOs
7161
run: |
72-
cargo build --release
62+
ls -lh
7363
7464
- name: Docker Login
7565
uses: docker/login-action@v3

0 commit comments

Comments
 (0)