-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: try GitHub Action * fix branch name * migrate 33 tasks * add RUSTFLAGS and RUSTDOCFLAGS to env * respond to review
- Loading branch information
Showing
3 changed files
with
433 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: 'Build' | ||
description: 'Build nix' | ||
inputs: | ||
# This is required | ||
TARGET: | ||
required: true | ||
|
||
BUILD: | ||
required: false | ||
default: build | ||
|
||
CLIPPYFLAGS: | ||
required: false | ||
default: -D warnings -A unknown-lints | ||
|
||
RUSTFLAGS: | ||
required: false | ||
default: -D warnings -A unknown-lints | ||
|
||
RUSTDOCFLAGS: | ||
required: false | ||
default: -D warnings | ||
|
||
TOOL: | ||
description: 'Tool used to involve the BUILD command, can be cargo or cross' | ||
required: false | ||
default: cargo | ||
|
||
ZFLAGS: | ||
required: false | ||
default: | ||
|
||
NOHACK: | ||
description: "whether to run cargo hack" | ||
required: false | ||
default: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: set up Rust env | ||
shell: bash | ||
run: | | ||
echo "RUSTFLAGS=${{ inputs.RUSTFLAGS }}" >> $GITHUB_ENV | ||
echo "RUSTDOCFLAGS=${{ inputs.RUSTDOCFLAGS }}" >> $GITHUB_ENV | ||
- name: debug info | ||
shell: bash | ||
run: | | ||
${{ inputs.TOOL }} -Vv | ||
rustc -Vv | ||
- name: build | ||
shell: bash | ||
run: ${{ inputs.TOOL }} ${{ inputs.BUILD }} ${{ inputs.ZFLAGS }} --target ${{ inputs.TARGET }} --all-targets --all-features | ||
|
||
- name: doc | ||
shell: bash | ||
run: ${{ inputs.TOOL }} doc ${{ inputs.ZFLAGS }} --no-deps --target ${{ inputs.TARGET }} --all-features | ||
|
||
- name: clippy | ||
shell: bash | ||
run: ${{ inputs.TOOL}} clippy ${{ inputs.ZFLAGS }} --target ${{ inputs.TARGET }} --all-targets --all-features -- ${{ inputs.CLIPPYFLAGS }} | ||
|
||
- name: Set up cargo-hack | ||
if: inputs.NOHACK == 'false' | ||
uses: taiki-e/install-action@cargo-hack | ||
|
||
- name: run cargo hack | ||
shell: bash | ||
if: inputs.NOHACK == 'false' | ||
run: ${{ inputs.TOOL }} hack ${{ inputs.ZFLAGS }} check --target ${{ inputs.TARGET }} --each-feature |
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,27 @@ | ||
name: 'Test' | ||
description: 'Test nix' | ||
inputs: | ||
# This is required | ||
TARGET: | ||
required: true | ||
|
||
TOOL: | ||
description: 'Tool used to involve the test command, can be cargo or cross' | ||
required: false | ||
default: cargo | ||
|
||
RUSTFLAGS: | ||
required: false | ||
default: -D warnings -A unknown-lints | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: set up Rust env | ||
shell: bash | ||
run: | | ||
echo "RUSTFLAGS=${{ inputs.RUSTFLAGS }}" >> $GITHUB_ENV | ||
- name: test | ||
shell: bash | ||
run: ${{ inputs.TOOL }} test --target ${{ inputs.TARGET }} --all-features |
Oops, something went wrong.