Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: try GitHub Action #2166

Merged
merged 5 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
66 changes: 66 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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: debug info
shell: bash
run: |
${{ inputs.TOOL }} -Vv
rustc -Vv

- name: build
SteveLauC marked this conversation as resolved.
Show resolved Hide resolved
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
18 changes: 18 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Test'
description: 'Test nix'
inputs:
SteveLauC marked this conversation as resolved.
Show resolved Hide resolved
# This is required
TARGET:
required: true

TOOL:
description: 'Tool used to involve the test command, can be cargo or cross'
required: false
default: cargo

runs:
using: "composite"
steps:
- name: test
shell: bash
run: ${{ inputs.TOOL }} test --target ${{ inputs.TARGET }} --all-features
Loading