Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/actions/build/action.yml
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
27 changes: 27 additions & 0 deletions .github/actions/test/action.yml
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
Loading