diff options
author | Ondřej Čertík <ondrej@certik.us> | 2020-02-20 16:26:02 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-20 16:26:02 -0600 |
commit | 2292bbd1d57c97d800e87e1cb6ccd1981ad50333 (patch) | |
tree | 9000e8f9f875a6b1ada1c4b692875d321b5cb20d | |
parent | 21020c2f60a2a0f07bc4ef2506004ed5a361793b (diff) | |
parent | 1dd8df9120fd6d7b4381b8dbc63acc4325450ad7 (diff) | |
download | fpm-2292bbd1d57c97d800e87e1cb6ccd1981ad50333.tar.gz fpm-2292bbd1d57c97d800e87e1cb6ccd1981ad50333.zip |
Merge pull request #37 from certik/ci
CI: Do not install GFortran (already present)
-rw-r--r-- | .github/workflows/CI.yml | 8 | ||||
-rw-r--r-- | src/main.rs | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fce83bb..fcc50b6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,7 +24,7 @@ jobs: gcc_v: [9] # Version of GFortran we want to use. rust: [stable] env: - FC: gfortran-${{ matrix.gcc_v }} + FC: gfortran GCC_V: ${{ matrix.gcc_v }} steps: @@ -38,16 +38,10 @@ jobs: - name: Install GFortran Linux if: contains(matrix.os, 'ubuntu') run: | - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo apt-get update - sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V} sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \ --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V} - - name: Install GFortran macOS - if: contains(matrix.os, 'macos') - run: brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true - name: Install Rust uses: hecrj/setup-rust-action@v1 diff --git a/src/main.rs b/src/main.rs index be71598..340c1d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ use structopt::StructOpt; use toml::Value; use std::path::{Path, PathBuf}; +use std::env; #[derive(Debug, StructOpt)] struct Cli { @@ -67,10 +68,14 @@ add_executable(p1 ../main.f90 {}) }; args.extend(vec!["-B", "build", "."]); println!("[+] cmake {:?}", args); + let fc : String = match env::var("FC") { + Ok(val) => val, + Err(_) => "gfortran".to_string(), + }; let output = std::process::Command::new("cmake") .args(&args) .current_dir(target_dir) - .env("FC", "gfortran") + .env("FC", fc) .output().unwrap(); println!("status: {}", output.status); println!("stdout: {}", String::from_utf8_lossy(&output.stdout)); |