Skip to content
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

CI: Install Rust manually #72

Merged
merged 2 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 31 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ jobs:
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
target: ${{ env.CORE_TARGET }}

# install Rust
- name: Install Rust toolchain
run: rustup toolchain install --profile=minimal ${{ matrix.rust }}
- name: Set default Rust toolchain
run: rustup default ${{ matrix.rust }}
- name: Install Rust target for cross-compilation
run: rustup target add ${{ env.CORE_TARGET }} --toolchain ${{ matrix.rust }}

# caching
- name: make rustc version available to cache keys
id: rustc
run: echo "::set-output name=version::$(rustc -V)"
Expand All @@ -52,24 +56,34 @@ jobs:
key: cargo-target-${{ runner.os }}-${{ steps.rustc.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-target-${{ runner.os }}-${{ steps.rustc.outputs.version }}-

# run tests
- name: Run testsuite
run: cargo xtest

static-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy, rustfmt
- run: cargo fmt --all -- --check
- uses: actions-rs/clippy-check@v1
with:
args: "-- --deny warnings"
token: ${{ secrets.GITHUB_TOKEN }}

# install Rust
- name: Install Rust toolchain
run: rustup toolchain install --profile=minimal stable
- name: Set default Rust toolchain
run: rustup default stable
- name: Install Rust components
run: |
rustup component add rustfmt clippy
cargo fmt --version
cargo clippy --version

# run tests
- run: cargo fmt -- --check
- run: cargo clippy -- --deny warnings
- run: cargo fmt -- --check
working-directory: test-flip-link-app/
- run: cargo clippy -- --deny warnings
working-directory: test-flip-link-app/

# Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
# bors.tech integration
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- [#72]: CI: Install Rust manually
- [#71]: Add changelog enforcer
- [#70]: Support addition in ORIGIN

[#72]: https://github.com/knurling-rs/flip-link/pull/72
[#71]: https://github.com/knurling-rs/flip-link/pull/71
[#70]: https://github.com/knurling-rs/flip-link/pull/70

Expand Down