-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 1 * 设置github workflow * 1
- Loading branch information
Showing
9 changed files
with
128 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Reusable workflow example | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
|
||
- name: Cache build tools | ||
id: cache-build-tools | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-build-tools | ||
dadk_version: 0.1.2 | ||
with: | ||
path: | | ||
~/.cargo | ||
~/.rustup | ||
~/.bashrc | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.dadk_version }}-${{ hashFiles('.github/workflows/cache-toolchain.yml') }} | ||
|
||
- if: ${{ steps.cache-build-tools.outputs.cache-hit != 'true' }} | ||
name: Install toolchain | ||
continue-on-error: true | ||
run: | | ||
sudo sh -c "apt update && apt install -y llvm-dev libclang-dev clang gcc-multilib libssl-dev pkg-config" | ||
cargo install cargo-binutils | ||
rustup toolchain install nightly | ||
rustup default nightly | ||
rustup component add rust-src | ||
rustup component add llvm-tools-preview | ||
rustup target add x86_64-unknown-none | ||
rustup component add rust-src --toolchain nightly-2023-08-15-x86_64-unknown-linux-gnu | ||
rustup component add rustfmt | ||
cargo install dadk --version 0.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Standard Check | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
# ensure the toolchain is cached | ||
ensure-toolchain: | ||
uses: ./.github/workflows/cache-toolchain.yml | ||
|
||
fmt: | ||
name: fmt check | ||
runs-on: ubuntu-latest | ||
needs: [ensure-toolchain] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Cache build tools | ||
id: cache-build-tools | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-build-tools | ||
dadk_version: 0.1.2 | ||
with: | ||
path: | | ||
~/.cargo | ||
~/.rustup | ||
~/.bashrc | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.dadk_version }}-${{ hashFiles('.github/workflows/cache-toolchain.yml') }} | ||
|
||
- name: Check format | ||
run: | | ||
make fmt-check | ||
build: | ||
name: build check | ||
runs-on: ubuntu-latest | ||
needs: [ensure-toolchain] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Cache build tools | ||
id: cache-build-tools | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-build-tools | ||
dadk_version: 0.1.2 | ||
with: | ||
path: | | ||
~/.cargo | ||
~/.rustup | ||
~/.bashrc | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.dadk_version }}-${{ hashFiles('.github/workflows/cache-toolchain.yml') }} | ||
|
||
- name: Build check | ||
run: | | ||
make all -j $(nproc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
{ | ||
"rust-analyzer.linkedProjects": [ | ||
"./Cargo.toml", | ||
], | ||
"rust-analyzer.check.overrideCommand": [ | ||
"cargo", | ||
"+nightly", | ||
"-Z", | ||
"build-std=core,alloc,compiler_builtins", | ||
"check", | ||
"--workspace", | ||
"--message-format=json", | ||
"--target", | ||
"target.json", | ||
"make", | ||
"check" | ||
], | ||
|
||
"rust-analyzer.cargo.target": "x86_64-unknown-dragonos", | ||
|
||
} | ||
// "rust-analyzer.cargo.target": "x86_64-unknown-dragonos", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[toolchain] | ||
channel = "nightly-2023-08-15" | ||
components = ["rust-src"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters