-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Zondax/refactor/github_actions
Move CI to Github Actions
- Loading branch information
Showing
7 changed files
with
113 additions
and
74 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,63 @@ | ||
name: "Main workflow" | ||
on: | ||
- push | ||
|
||
jobs: | ||
configure: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
uid_gid: ${{ steps.get-user.outputs.uid_gid }} | ||
steps: | ||
- id: get-user | ||
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)" | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: zondax/rust-ci:latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- run: sudo apt-get install -y libudev-dev libusb-1.0-0-dev | ||
- name: show versions | ||
run: | | ||
rustup show | ||
- name: rustfmt | ||
run: | | ||
cargo fmt --version | ||
cargo fmt -- --check | ||
- name: rust cache | ||
uses: Swatinem/rust-cache@v1 | ||
with: | ||
# setup sharedKey to share cache with other jobs | ||
sharedKey: ${{ github.run_id }}-${{ github.run_attempt }} | ||
|
||
- name: clippy | ||
run: | | ||
cargo clippy --version | ||
cargo clippy --all-features | ||
tests: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: zondax/rust-ci:latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Rust Dependency Cache | ||
uses: Swatinem/rust-cache@v1 | ||
with: | ||
# setup sharedKey to share cache with other jobs | ||
sharedKey: ${{ github.run_id }}-${{ github.run_attempt }} | ||
|
||
- run: sudo apt-get install -y libudev-dev libusb-1.0.0-dev | ||
- name: test --all-features | ||
run: | | ||
#with --lib we only test the unit tests | ||
cargo test --lib --all-features |
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,24 @@ | ||
name: Security audit | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**/Cargo.toml' | ||
- '**/Cargo.lock' | ||
|
||
jobs: | ||
security_audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- run: cargo audit | ||
|
||
# disabled until we can change directory | ||
# see https://github.com/actions-rs/audit-check/issues/194 | ||
# - name: Run audit | ||
# uses: actions-rs/audit-check@v1 | ||
# with: | ||
# token: ${{ secrets.GITHUB_TOKEN }} |
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,23 @@ | ||
name: Scheduled security audit | ||
|
||
on: | ||
schedule: | ||
# run everyday at midnight | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
security_audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- run: cargo audit | ||
|
||
# disabled until we can change directory | ||
# see https://github.com/actions-rs/audit-check/issues/194 | ||
# - name: Run audit | ||
# uses: actions-rs/audit-check@v1 | ||
# with: | ||
# token: ${{ secrets.GITHUB_TOKEN }} |
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