From 366f1384a442240700c682a36b1e6671979ae56e Mon Sep 17 00:00:00 2001 From: Andreas Longva Date: Wed, 13 Jan 2021 11:03:55 +0100 Subject: [PATCH] Add compilation of minimal hello world example to CI This prevents issue #3 from re-occurring. --- .github/workflows/build_and_test.yml | 88 +++++++++++++++------------- matrixcompare-minimal/Cargo.toml | 8 +++ matrixcompare-minimal/src/main.rs | 8 +++ 3 files changed, 64 insertions(+), 40 deletions(-) create mode 100644 matrixcompare-minimal/Cargo.toml create mode 100644 matrixcompare-minimal/src/main.rs diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 3023af0..17b023f 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -1,40 +1,48 @@ -name: Build and run tests - -on: - # Trigger the workflow on push or pull request, - # but only for the master branch - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - ubuntu: - - name: Test on Ubuntu - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Update Rust - run: rustup update - - - name: Run tests - run: cargo test --all-targets - - windows: - - name: Test on Windows - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - name: Run tests - run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cargo test --all-targets - shell: cmd - +name: Build and run tests + +on: + # Trigger the workflow on push or pull request, + # but only for the master branch + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + ubuntu: + + name: Test on Ubuntu + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Update Rust + run: rustup update + + - name: Run tests + run: cargo test --all-targets + + - name: Build matrixcompare-minimal + run: cargo build --manifest-path=matrixcompare-minimal/Cargo.toml + + windows: + + name: Test on Windows + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + - name: Run tests + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + cargo test --all-targets + shell: cmd + + - name: Build matrixcompare-minimal + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + cargo build --manifest-path=matrixcompare-minimal/Cargo.toml + shell: cmd diff --git a/matrixcompare-minimal/Cargo.toml b/matrixcompare-minimal/Cargo.toml new file mode 100644 index 0000000..5f2b138 --- /dev/null +++ b/matrixcompare-minimal/Cargo.toml @@ -0,0 +1,8 @@ +# See comment in src/main.rs for the purpose of this crate +[package] +name = "matrixcompare-minimal" +version = "0.1.0" +edition = "2018" + +[dependencies] +matrixcompare = { version = "0.1.4", path = ".." } diff --git a/matrixcompare-minimal/src/main.rs b/matrixcompare-minimal/src/main.rs new file mode 100644 index 0000000..8197731 --- /dev/null +++ b/matrixcompare-minimal/src/main.rs @@ -0,0 +1,8 @@ +//! This "minimal" crate is just a means of testing in CI that the most barebones +//! example involving `matrixcompare` compiles. This is intended to prevent an issue like +//! that reported in [issue #3](https://github.com/Andlon/matrixcompare/issues/3) from +//! happening again. + +fn main() { + println!("Hello, world!"); +}