Last active
August 25, 2019 09:31
-
-
Save yoshuawuyts/3a9f3c345f26f66e06753119a19c8a68 to your computer and use it in GitHub Desktop.
github ci workflow
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
| name: Rust | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| name: ${{ matrix.rust }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macOS-latest, ubuntu-latest] # windows-latest, macOS-latest | |
| rust: [nightly] | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: Install rustup | |
| if: matrix.os == 'macOS-latest' | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=${{ matrix.rust }} -y | |
| export PATH="$HOME/.cargo/bin:$PATH" | |
| - name: Set toolchain | |
| run: | | |
| export PATH="$HOME/.cargo/bin:$PATH" | |
| rustup override set ${{ matrix.rust }} | |
| rustup update | |
| rustup component add rustfmt | |
| rustc --version | |
| cargo --version | |
| rustup --version | |
| - name: Cargo check | |
| run: | | |
| export PATH="$HOME/.cargo/bin:$PATH" | |
| cargo check --all --benches --bins --examples --tests | |
| # env: | |
| # RUSTFLAGS: "-D warnings" | |
| - name: Cargo test | |
| run: | | |
| export PATH="$HOME/.cargo/bin:$PATH" | |
| cargo test --all --verbose | |
| - name: Cargo fmt | |
| run: | | |
| export PATH="$HOME/.cargo/bin:$PATH" | |
| cargo fmt --all -- --check |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I couldn't get the
export PATHstuff to properly persist. If I add it tobashrcand then source it,nvmapparently trips up. This was the best way to make things work on the short term (though it's not pretty).