-
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.
ci(github): Add GitHub Actions workflows
- Loading branch information
Showing
3 changed files
with
61 additions
and
1 deletion.
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,16 @@ | ||
name: Build | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Print Rust version | ||
run: rustc -vV | ||
- name: Run tests | ||
run: cargo test --all-features --verbose | ||
- name: Run bench | ||
run: cargo bench --all-features --verbose | ||
- name: Run doc | ||
run: cargo doc --all-features --verbose |
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,42 @@ | ||
name: pre-commit | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Generate Cargo.lock | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: generate-lockfile | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Detect code style issues | ||
uses: pre-commit/[email protected] | ||
env: | ||
SKIP: no-commit-to-branch | ||
|
||
- name: Generate patch file | ||
if: failure() | ||
run: | | ||
git diff-index -p HEAD > "${PATCH_FILE}" | ||
[ -s "${PATCH_FILE}" ] && echo "UPLOAD_PATCH_FILE=${PATCH_FILE}" >> "${GITHUB_ENV}" | ||
env: | ||
PATCH_FILE: pre-commit.patch | ||
|
||
- name: Upload patch artifact | ||
if: failure() && env.UPLOAD_PATCH_FILE != null | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.UPLOAD_PATCH_FILE }} | ||
path: ${{ env.UPLOAD_PATCH_FILE }} |
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