This repository has been archived by the owner on Jul 16, 2020. It is now read-only.
-
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.
Basic Rust testing + merge commit detection with Github Actions
- Loading branch information
1 parent
a7f5635
commit 3177227
Showing
2 changed files
with
44 additions
and
0 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,19 @@ | ||
name: Enarx Standard Tests | ||
# Automated testing common to all Enarx repositories. | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
commits: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
ref: ${{ github.head_ref }} | ||
# Ensure pull requests do not contain merge commits. | ||
- name: No merge commits | ||
# Merge commits have two parent commits. This command iterates through | ||
# all commits added by the PR (everything since the base ref) and fails | ||
# if it finds multiple parents. If all commits only have one, it exits | ||
# successfully. | ||
run: git rev-list origin/${{ github.base_ref }}.. | xargs -n1 -I{} sh -c '! git rev-parse {}^2' |
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,25 @@ | ||
name: Enarx Rust Tests | ||
# Automated testing specific to Enarx's Rust repositories. | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
# Ensure all code is properly formatted with `rustfmt`. | ||
rust-formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: rustfmt | ||
run: cargo fmt -- --check | ||
|
||
# Build and test the crate. | ||
rust-build-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
# Ensure the project builds correctly. | ||
- name: Build | ||
run: cargo build --verbose | ||
# Run any specified Rust tests. | ||
- name: Run tests | ||
run: cargo test --verbose |