Update github workflow to use rustup and multiple rust versions

This commit is contained in:
Denis Redozubov 2023-06-28 21:51:21 +04:00
parent d8f1fa078f
commit f30e16a63f
1 changed files with 14 additions and 12 deletions

View File

@ -1,22 +1,24 @@
name: Rust
name: Cargo Build & Test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
env:
CARGO_TERM_COLOR: always
jobs:
build:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- uses: actions/checkout@v3
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --verbose