Skip to content

Commit 2f0eeff

Browse files
committed
Merge PR #138 (Migrate C-I tests from Azure to GitHub actions)
This merge brings PR #138 (Migrate C-I tests from Azure Dev Pipelines to GitHub actions, by @yantosca) into the KPP 3.3.1 (or 3.4.0) development stream. PR #138 moves the C-I tests, which ran when pushes or pull requests were made, from MS Azure Dev Pipelines to GitHub Actions. This now has the following advantages: - We no longer need to maintain an external Azure Dev Pipelines account - We can run the C-I tests on multiple compilers - GitHub Actions has enough memory to run all C-I tests, including those for MCM (Azure did not) Also we have added a "Lint" GitHub action to flag any security issues with all other GitHub Actions configuration files. Signed-off-by: Bob Yantosca <[email protected]>
2 parents 4847e07 + 5e42cbe commit 2f0eeff

File tree

6 files changed

+285
-219
lines changed

6 files changed

+285
-219
lines changed

.ci-pipelines/Dockerfile

Lines changed: 0 additions & 44 deletions
This file was deleted.

.ci-pipelines/build-testing.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Workflow to run linting checks on source
2+
name: Lint
3+
4+
# Controls when the workflow will run
5+
on:
6+
# Triggers the workflow on pushes to the "main" branch, i.e., PR merges
7+
push:
8+
branches: [ "main" ]
9+
10+
# Triggers the workflow on pushes to open pull requests with code changes
11+
pull_request:
12+
paths:
13+
- '.github/workflows/*.yml'
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
# Cancel jobs running if new commits are pushed
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
23+
# Workflow run - one or more jobs that can run sequentially or in parallel
24+
jobs:
25+
# This workflow contains a single job called "lint"
26+
lint:
27+
# The type of runner that the job will run on
28+
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: false
31+
32+
# Steps represent a sequence of tasks that will be executed as part of the job
33+
steps:
34+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
35+
- name: Checkout code
36+
with:
37+
persist-credentials: false
38+
uses: actions/checkout@v4
39+
40+
- name: Install Python
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.x'
44+
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
python -m venv ci_venv
49+
. ci_venv/bin/activate
50+
pip install zizmor==0.9.2
51+
52+
# Apply GitHub Actions linter, zizmor
53+
- name: zizmor
54+
if: always()
55+
run: |
56+
cd ${{ github.workspace }}
57+
. ci_venv/bin/activate
58+
zizmor .github/workflows/*.yml

.github/workflows/run-ci-tests.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
#
3+
# GitHub Action to run C-I tests with GCC compilers
4+
#
5+
name: Run C-I tests
6+
7+
on:
8+
push:
9+
branches:
10+
- '**'
11+
pull_request:
12+
branches:
13+
- '**'
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
env:
19+
KPP_HOME: ${{ github.workspace }}
20+
KPP_FLEX_LIB_DIR: /usr/lib/x86_64-linux-gnu
21+
strategy:
22+
matrix:
23+
gcc-version: [9, 10, 11, 12, 13]
24+
25+
26+
name: Run C-I tests with GCC ${{ matrix.gcc-version }}
27+
steps:
28+
- name: Checkout KPP
29+
uses: actions/checkout@v4
30+
with:
31+
persist-credentials: false
32+
33+
34+
- name: Install libraries
35+
run: |
36+
sudo apt update -y
37+
sudo apt install -y flex bison libfl-dev
38+
sudo apt install -y gcc-${{ matrix.gcc-version }} g++-${{ matrix.gcc-version }} gfortran-${{ matrix.gcc-version }}
39+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc-version }} 100 \
40+
--slave /usr/bin/g++ g++ /usr/bin/g++-${{ matrix.gcc-version }} \
41+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.gcc-version }}
42+
43+
44+
- name: Verify environment
45+
run: |
46+
echo '%%% COMPILERS %%%'
47+
gcc --version
48+
echo ''
49+
g++ --version
50+
echo ''
51+
gfortran --version
52+
echo ''
53+
echo '%%% ENVIRONMENT %%%'
54+
echo "flex = $(which flex)"
55+
echo "bison = $(which bison)"
56+
echo "KPP_HOME = $KPP_HOME"
57+
echo "KPP_FLEX_LIB_DIR = $KPP_FLEX_LIB_DIR"
58+
59+
- name: Compile with Make
60+
run: |
61+
cd $KPP_HOME/src
62+
make all
63+
64+
65+
- name: Run C-I tests
66+
run: |
67+
cd $KPP_HOME/.ci-pipelines
68+
./ci-testing-script.sh

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ All notable changes to this project will be documented in this file.
1111
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1212
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1313

14+
## [Unreleased] - TBD
15+
### Added
16+
- Added GitHub Action to run C-I tests with GCC compilers v9, v10, v11, v12, and v13
17+
- Added "Lint" GitHub Action to check other actions for security issues
18+
19+
### Changed
20+
- Updated ReadTheDocs documentation to reflect that C-I tests are now done as a GitHub Action
21+
22+
### Removed
23+
- Removed C-I tests on Microsoft Azure Dev Pipelines
24+
1425
## [3.3.0] - 2025-07-17
1526
### Added
1627
- New integrator: `rosenbrock_h211b_qssa.f90`

0 commit comments

Comments
 (0)