Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Do not install GFortran (already present) #37

Merged
merged 3 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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