-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup github actions. Replace actions-rs to other maintained actions.
- Loading branch information
Showing
8 changed files
with
137 additions
and
226 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,26 @@ | ||
name: 'Install required cargo binaries' | ||
description: "install cargo binaries to build C ABI library. Requires cargo installed before use." | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check rustup toolchain | ||
run: rustup default | ||
shell: bash | ||
- name: cbindgen-exists | ||
id: cbindgenCheck | ||
run: test -e ~/.cargo/bin/cbindgen | ||
continue-on-error: true | ||
shell: bash | ||
- name: Install cbindgen | ||
if: ${{ always() && steps.cbindgenCheck.outcome == 'failure' }} | ||
run: cargo +stable install cbindgen | ||
shell: bash | ||
- name: cargo-c-exists | ||
id: cargoCCheck | ||
run: test -e ~/.cargo/bin/cargo-cbuild | ||
continue-on-error: true | ||
shell: bash | ||
- name: Install cargo-c | ||
if: ${{ always() && steps.cargoCCheck.outcome == 'failure' }} | ||
run: cargo +stable install cargo-c --version 0.9.12 | ||
shell: bash |
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,17 @@ | ||
name: 'Lint and Format' | ||
description: "Lint and format check. Requires cargo, rustfmt and clippy installed before use." | ||
inputs: | ||
github_token: | ||
description: 'github token' | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Format check | ||
run: cargo fmt -- --check | ||
shell: bash | ||
- name: Lint check | ||
uses: giraffate/clippy-action@v1 | ||
with: | ||
github_token: ${{ inputs.github_token }} | ||
clippy_flags: -- -D warnings -A dead_code -A improper_ctypes_definitions |
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,62 @@ | ||
# Only check that build passes | ||
name: Basic check | ||
on: | ||
workflow_call: | ||
inputs: | ||
toolchain: | ||
type: string | ||
required: true | ||
secrets: | ||
gh_token: | ||
required: true | ||
|
||
jobs: | ||
lint: | ||
name: lint and format check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.toolchain }} | ||
- name: Install cargo | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: ${{ inputs.toolchain }} | ||
components: rustfmt, clippy | ||
rustflags: "" | ||
override: true | ||
- name: Lint and format | ||
uses: ./.github/actions/lint_format | ||
with: | ||
github_token: ${{ secrets.gh_token }} | ||
rust_test: | ||
name: cargo test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.toolchain }} | ||
- name: Install required libs (Ubuntu) | ||
run: sudo apt-get install libxkbcommon-dev | ||
- name: Install cargo | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: ${{ inputs.toolchain }} | ||
rustflags: "" | ||
override: true | ||
- name: Run rust test | ||
run: cargo test --features capi |
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
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
Oops, something went wrong.