Skip to content

Commit

Permalink
add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cheny16 committed Oct 6, 2024
1 parent c750e01 commit af91406
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflow/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI for speedy.f90

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository code
- name: Checkout code
uses: actions/checkout@v2

# Step 2: Install dependencies (gfortran, openmp, netcdf-fortran)
- name: Install gfortran, OpenMP, and netcdf-fortran
run: |
sudo apt-get update
sudo apt-get install -y gfortran libnetcdff-dev
# Step 3: Set the NETCDF environment variable
- name: Set NETCDF environment variable
run: echo "NETCDF=$(nc-config --prefix)" >> $GITHUB_ENV

# Step 4: Compile the project
- name: Compile the Fortran project
run: |
export NETCDF=$(nc-config --prefix)
bash build.sh --target general | tee compile.out
# Step 5: Check for compilation
- name: Check for compilation
run: |
if ! grep -q "successful" compile.out; then
echo "Compilation failed."
cat compile.out
exit 1 # Fail the action
else
echo "Compilation successful."
fi

0 comments on commit af91406

Please sign in to comment.