mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-06 13:27:43 +00:00
设置ci流水线
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
name: Rust
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
@@ -11,12 +11,48 @@ env:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
rust:
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: cargo build --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
- name: cache protoc bin
|
||||
id: cache-protoc-action
|
||||
uses: actions/cache@v3
|
||||
env:
|
||||
cache-name: cache-protoc-action-bin
|
||||
with:
|
||||
path: /usr/local/bin/protoc
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-v0.0.1
|
||||
|
||||
- name: install protoc
|
||||
if: steps.cache-protoc-action.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
wget https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protoc-27.0-linux-x86_64.zip
|
||||
unzip protoc-27.0-linux-x86_64.zip -d protoc3
|
||||
mv protoc3/bin/* /usr/local/bin/
|
||||
chmod +x /usr/local/bin/protoc
|
||||
rm -rf protoc-27.0-linux-x86_64.zip protoc3
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: ${{ matrix.rust }}
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --verbose
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all --verbose
|
||||
|
||||
Reference in New Issue
Block a user