-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add matrix CI using Github Actions #353
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4e494ea
add matrix CI using Github Actions
5475b97
fix formatting issue
f2f3535
use cargo fmt check option
1ccc560
cargo fmt fixes
cfe326a
cargo clippy fixes
b5777c1
fix nightly build
09a6cb6
fix clippy warnings
6c0eca1
fix clippy warnings
4042fc0
Merge branch 'master' into github-actions-ci
e5819f7
Merge branch 'master' into github-actions-ci
d22be74
Let's not wait for appveyor
killercup e8901df
Merge branch 'master' into github-actions-ci
d8bb36a
Run rustfmt separately
df5f6a8
fix incorrect formatting
b21bfa1
Separate check & clippy as well
32b7e34
Remove unnecessary components for build & test tasks
8b087fb
Cache cargo registry & index during build; only build nightly on ubun…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,111 @@ | ||
name: build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
rust: [stable] | ||
steps: | ||
- uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: ${{ matrix.rust }} | ||
- uses: actions/checkout@master | ||
- name: Cache cargo registry | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | ||
- name: Cache cargo index | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/git | ||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose | ||
|
||
build-nightly: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
rust: [nightly] | ||
steps: | ||
- uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: ${{ matrix.rust }} | ||
- uses: actions/checkout@master | ||
- name: Cache cargo registry | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | ||
- name: Cache cargo index | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/git | ||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} | ||
- name: Build | ||
run: cargo build --verbose | ||
continue-on-error: true | ||
- name: Run tests | ||
run: cargo test --verbose | ||
continue-on-error: true | ||
|
||
check: | ||
name: check (ubuntu-latest, stable) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: stable | ||
- name: Checkout sources | ||
uses: actions/checkout@v1 | ||
- name: Cargo Check | ||
run: cargo check | ||
|
||
clippy: | ||
name: clippy (ubuntu-latest, stable) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: stable | ||
components: clippy | ||
- name: Checkout sources | ||
uses: actions/checkout@v1 | ||
- name: Cache cargo registry | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | ||
- name: Cache cargo index | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cargo/git | ||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} | ||
- name: Cache cargo build | ||
uses: actions/cache@v1 | ||
with: | ||
path: target | ||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('Cargo.lock') }} | ||
- name: Cargo Clippy | ||
run: cargo clippy -- -D warnings -A deprecated | ||
|
||
fmt: | ||
name: fmt (ubuntu-latest, stable) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: stable | ||
components: rustfmt | ||
- name: Checkout sources | ||
uses: actions/checkout@v1 | ||
- name: Check Formatting | ||
run: cargo fmt --all -- --check |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
status = [ | ||
"build (ubuntu-latest, stable)", | ||
"build (ubuntu-latest, nightly)", | ||
"build (windows-latest, stable)", | ||
"build (macOS-latest, stable)", | ||
"continuous-integration/travis-ci/push", | ||
"continuous-integration/appveyor/branch", | ||
] | ||
use_squash_merge = true |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does
hecrj/setup-rust-action
provide compared toaction-rs/toolchain
?also, it would be nice to use cache, see https://github.com/iqlusioninc/crates/blob/develop/.github/workflows/rust.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly simplifies the install of the rustc version & components with