Add initial GitHub CI #2
This file contains 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: Continuous integration | |
on: push | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_and_test: | |
name: Build and test | |
runs-on: ubuntu-latest | |
container: opensuse/tumbleweed | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- distribution | |
- stable | |
- beta | |
- nightly | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Install the ${{ matrix.toolchain }} Rust toolchain | |
shell: bash | |
run: | | |
if [ ${{ matrix.toolchain }} == distribution ]; then | |
zypper --non-interactive install cargo rust | |
else | |
zypper --non-interactive install rustup | |
rustup update ${{ matrix.toolchain }} | |
rustup default ${{ matrix.toolchain }} | |
fi | |
- name: Build the project | |
run: cargo build --verbose | |
- name: Run tests | |
run: cargo test --verbose |