-
Notifications
You must be signed in to change notification settings - Fork 341
Add github actions workflows #253
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,57 @@ | ||
on: [push] | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build and test on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Install nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
|
||
- name: check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --all --benches --bins --examples --tests | ||
|
||
- name: check unstable | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
args: --features unstable --all --benches --bins --examples --tests | ||
|
||
- name: tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all --doc --features unstable | ||
|
||
check_fmt_and_docs: | ||
name: Checking fmt and docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: setup | ||
run: | | ||
rustup default nightly | ||
rustup component add rustfmt | ||
test -x $HOME/.cargo/bin/mdbook || ./ci/install-mdbook.sh | ||
rustc --version | ||
- name: mdbook | ||
run: | | ||
mdbook build docs | ||
- name: fmt | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Docs | ||
run: cargo doc --features docs,unstable |
This file contains hidden or 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 @@ | ||
on: push | ||
name: Clippy check | ||
jobs: | ||
clippy_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- id: component | ||
uses: actions-rs/components-nightly@v1 | ||
with: | ||
component: clippy | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ steps.component.outputs.toolchain }} | ||
override: true | ||
- run: rustup component add clippy | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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.
Did you see the install-mdbook script? That way saves quite a bit of time compared to the
cargo install mdbook
.However, the script is fragile because it ultimately relies on a specific release filename pattern and it would be nice if we could have a more general solution. (This is currently an issue for another CI related PR here).
I think a better way might be to create a docker image based on the official image (or slim or docs.rs) with all of the tools we need (deadlinks, mdbook, tarpaulin?) pre-installed. Then we could use the container.image setting to set the environment so that stuff is available without having to rebuild it.
Another github action could handle docker image related tasks.
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.
I agree this would be really nice, and it would probably worth doing this in a follow-up!
Perhaps it's worth opening an issue for this on https://github.com/actions-rs/meta/issues also; I agree that having a general solution for this would probably be very valuable to a lot of people.
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.
cargo install mdbook
should be avoided, it adds ~8 min of build time.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.
Wow, long. I will fix it tonight, so take a moment