Skip to content

Instantly share code, notes, and snippets.

@yoshuawuyts
Last active August 25, 2019 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoshuawuyts/3a9f3c345f26f66e06753119a19c8a68 to your computer and use it in GitHub Desktop.
Save yoshuawuyts/3a9f3c345f26f66e06753119a19c8a68 to your computer and use it in GitHub Desktop.
github ci workflow
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
@yoshuawuyts
Copy link
Author

I couldn't get the export PATH stuff to properly persist. If I add it to bashrc and then source it, nvm apparently trips up. This was the best way to make things work on the short term (though it's not pretty).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment