From e3d2164f7275de7c56aed7ca28086d48ca46ba64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Tue, 14 Jan 2020 08:45:51 -0700 Subject: Refactor the CI.yml --- .github/workflows/CI.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 775e4f5..83f4fc4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -38,7 +38,7 @@ jobs: run: pip install --upgrade cmake - name: Install GFortran Linux - if: contains( matrix.os, 'ubuntu') + if: contains(matrix.os, 'ubuntu') run: | sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update @@ -47,15 +47,15 @@ jobs: --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V} - - name: Install Rust macOS - if: contains( matrix.os, 'macos') - run: | - curl https://sh.rustup.rs -sSf | sh -s -- -y - - name: Install GFortran macOS if: contains( matrix.os, 'macos') run: brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true + - name: Install Rust macOS + if: contains(matrix.os, 'macos') + run: | + curl https://sh.rustup.rs -sSf | sh -s -- -y + - name: Build run: | export PATH="$HOME/.cargo/bin:$PATH" -- cgit v1.2.3 From 6902f83809cdd2ed39881b3d2ea7a70c6a048ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Tue, 14 Jan 2020 08:46:01 -0700 Subject: Test on Windows --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 83f4fc4..d870b4e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] gcc_v: [9] # Version of GFortran we want to use. env: FC: gfortran-${{ matrix.gcc_v }} -- cgit v1.2.3 From ff51bcf0daf4effcf1f89ac95b549c065a093c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Tue, 14 Jan 2020 08:58:35 -0700 Subject: Set PATH only once --- .github/workflows/CI.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d870b4e..fa42b2f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -56,19 +56,20 @@ jobs: run: | curl https://sh.rustup.rs -sSf | sh -s -- -y + - name: Setting Rust path + if: contains(matrix.os, 'macos') + run: echo "::add-path::${HOME}/.cargo/bin" + - name: Build run: | - export PATH="$HOME/.cargo/bin:$PATH" cargo build --verbose - name: Run tests run: | - export PATH="$HOME/.cargo/bin:$PATH" cargo test --verbose # TODO: integrate these with `cargo test` above - name: Run manual tests run: | - export PATH="$HOME/.cargo/bin:$PATH" cargo run -- --help ./run_tests.sh -- cgit v1.2.3 From 30c7219ff8504b7597b65ef924e16c729e12e8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Tue, 14 Jan 2020 08:58:42 -0700 Subject: Install Rust on Windows --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fa42b2f..5cb1c98 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -52,7 +52,7 @@ jobs: run: brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true - name: Install Rust macOS - if: contains(matrix.os, 'macos') + if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows') run: | curl https://sh.rustup.rs -sSf | sh -s -- -y -- cgit v1.2.3 From 8d948b6689a8b218ff3c791c558285edbd30c8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Tue, 14 Jan 2020 09:03:33 -0700 Subject: Install Rust using an action --- .github/workflows/CI.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5cb1c98..721dd78 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,6 +21,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] gcc_v: [9] # Version of GFortran we want to use. + rust: [stable] env: FC: gfortran-${{ matrix.gcc_v }} GCC_V: ${{ matrix.gcc_v }} @@ -51,14 +52,10 @@ jobs: if: contains( matrix.os, 'macos') run: brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true - - name: Install Rust macOS - if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows') - run: | - curl https://sh.rustup.rs -sSf | sh -s -- -y - - - name: Setting Rust path - if: contains(matrix.os, 'macos') - run: echo "::add-path::${HOME}/.cargo/bin" + - name: Install Rust + uses: hecrj/setup-rust-action@v1 + with: + rust-version: ${{ matrix.rust }} - name: Build run: | @@ -70,6 +67,7 @@ jobs: # TODO: integrate these with `cargo test` above - name: Run manual tests + if: ! contains(matrix.os, 'windows') run: | cargo run -- --help ./run_tests.sh -- cgit v1.2.3 From 570c47cca18fcf58acbcb4279824c133afa063e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Tue, 14 Jan 2020 09:05:19 -0700 Subject: Rewrite the condition --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 721dd78..a3678a1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -67,7 +67,7 @@ jobs: # TODO: integrate these with `cargo test` above - name: Run manual tests - if: ! contains(matrix.os, 'windows') + if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos') run: | cargo run -- --help ./run_tests.sh -- cgit v1.2.3