Skip to content

Commit

Permalink
Merge pull request #37 from certik/ci
Browse files Browse the repository at this point in the history
CI: Do not install GFortran (already present)
  • Loading branch information
certik authored Feb 20, 2020
2 parents 21020c2 + 1dd8df9 commit 2292bbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use structopt::StructOpt;
use toml::Value;
use std::path::{Path, PathBuf};
use std::env;

#[derive(Debug, StructOpt)]
struct Cli {
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 2292bbd

Please sign in to comment.