Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
9cf7a7a
Migrating from azure pipelines to GHA with minor updates for Ruff and…
lamkina Jan 19, 2026
1d0a80e
Fix strategy matrix for mypy workflow
anthony-ozdemir Feb 3, 2026
b3cfd71
Update .github/workflows/fprettify.yaml
lamkina Feb 4, 2026
8db7f40
Update .github/workflows/clang_format.yaml
lamkina Feb 4, 2026
88c8ce4
Removing reference to azure in root README
lamkina Feb 4, 2026
ec760cc
Removing pypi workflow
lamkina Feb 4, 2026
88e9fd6
Adding specific ruff workflow and removing old format and lint workflow
lamkina Feb 4, 2026
ff3a1e4
updating ruff yaml extension
lamkina Feb 4, 2026
34c5431
Fixing indentation
lamkina Feb 4, 2026
e484d0c
Updating ruff workflow to fix gha error
lamkina Feb 5, 2026
f280eb3
Testing ruff pwd
lamkina Feb 5, 2026
042b4eb
Fixing ruff directory issues
lamkina Feb 5, 2026
d98f177
Debugging ruff formatting path
lamkina Feb 5, 2026
ea96700
Trying to fix path issues with gha and ruff
lamkina Feb 5, 2026
5ac78f5
Fixing an argument bug
lamkina Feb 5, 2026
3f51459
Trying to fix build bug with paths
lamkina Feb 5, 2026
b6f5096
Making the branch name check a callable workflow
lamkina Feb 5, 2026
342d9dc
Fixing bug with branch workflow
lamkina Feb 5, 2026
c08da3d
Removing pylint
lamkina Feb 5, 2026
25b908f
Improving docstrings
lamkina Feb 5, 2026
5baa589
Changing all .yml to .yaml for consistency
lamkina Feb 10, 2026
e7fb61b
Adding docker login action instead of command
lamkina Feb 10, 2026
94e3293
Removing isort workflow and config in favor of ruff
lamkina Feb 11, 2026
f8a702e
Adding import sorting to the select
lamkina Feb 11, 2026
da811a1
Refactoring build script and adding intel, removing standalone mypy w…
lamkina Feb 11, 2026
b20cc71
Adding explicit tapenade version
lamkina Feb 11, 2026
80d874b
Updating readme for new workflow setup
lamkina Feb 11, 2026
4da3a78
Bumping clang format to version 20
lamkina Feb 11, 2026
053c384
Bumping actions checkout to v6
lamkina Feb 11, 2026
3f327d9
Removing MDO Lab codeowners
lamkina Feb 11, 2026
2ac4151
Removing import sorting by default from Ruff config and adding sortin…
lamkina Feb 11, 2026
05cfcee
Updating readme, refactoring build workflow, and adding mypy to build…
lamkina Feb 11, 2026
582951c
Minor update to the build workflow for turning intel/gcc on or off
lamkina Feb 11, 2026
7d7ef20
Fixing env bug
lamkina Feb 11, 2026
30a1c97
Improving the logic checks for the build workflow for intel/gcc
lamkina Feb 11, 2026
a2db2c1
Fixing mypy
lamkina Feb 11, 2026
08d7ff2
Creating composite actions for build workflow to split jobs
lamkina Feb 11, 2026
930109c
Fixing .yml to .yaml
lamkina Feb 11, 2026
502dadf
Adding a checkout step for composite actions workflow
lamkina Feb 11, 2026
8d0b709
Removing composite actions and trying yaml anchor approach
lamkina Feb 11, 2026
0a22772
Fixing yaml anchor
lamkina Feb 11, 2026
8b24add
Fixing yaml anchors pt 2
lamkina Feb 11, 2026
4adc7d8
Addressing new round of comments pt 1
lamkina Feb 13, 2026
b6571d6
Restoring fprettify shell script
lamkina Feb 13, 2026
8217298
Fixing secrets docs in readme
lamkina Feb 13, 2026
97e5837
Updating workflow options section
lamkina Feb 13, 2026
fd0814e
Readme update and accounting for local/global ruff toml configs
lamkina Feb 13, 2026
3286a73
Fixing ruff config again
lamkina Feb 13, 2026
f328a25
Adding a standalone mypy workflow
lamkina Feb 13, 2026
ddbaa7d
Updating readme with mypy workflow
lamkina Feb 13, 2026
f993ecc
Removed flag for intel/gcc and will just build/test both always
lamkina Feb 16, 2026
8e3663a
Fixing secrets examples in readme to use inherit
lamkina Feb 16, 2026
80baaf7
Reverting path change
lamkina Feb 16, 2026
e0af275
Removing unecessary boolean flags
lamkina Feb 16, 2026
413d615
Adding clang-format script back
lamkina Feb 16, 2026
29b2168
Adding main as an acceptable branch for the client name checks
lamkina Feb 16, 2026
b0abb63
Adding timeout for ruff workflow
lamkina Feb 16, 2026
e6295bd
Adding refactored docker workflows
lamkina Feb 17, 2026
96987c6
Fixing yaml extensions
lamkina Feb 17, 2026
60e667f
Targeting the PR branch for the composite actions
lamkina Feb 17, 2026
f166200
Fixing env variables for docker-related workflows
lamkina Feb 17, 2026
c5b27e1
Refacotring the env setup to the composite action
lamkina Feb 17, 2026
9c45fc1
Another tweak to the environment setup for docker composite action
lamkina Feb 17, 2026
ced74f8
Set composite actions branch to main
lamkina Feb 17, 2026
e37e17e
Documentation update for composite actions
lamkina Feb 17, 2026
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
301 changes: 301 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,301 @@
# GitHub Actions Workflows
Comment thread
lamkina marked this conversation as resolved.

Reusable GitHub Actions workflows for Supercritical repositories. These workflows are called from individual repositories using the `workflow_call` trigger.

## Available Workflows

| Workflow | Description |
| :------- | :---------- |
| `build.yaml` | Build and test code in Docker container |
| `format-and-lint.yaml` | Python formatting and linting with ruff/pre-commit |
| `pypi.yaml` | Publish Python packages to PyPI |
| `tapenade.yaml` | Tapenade automatic differentiation checks |
| `clang_format.yaml` | C/C++ formatting checks |
| `fprettify.yaml` | Fortran 90 formatting checks |
| `isort.yaml` | Python import sorting checks |
| `pylint.yaml` | Python linting with pylint |
| `mypy.yaml` | Python type checking |
| `branch-name-check.yml` | Enforce branch naming conventions |
Comment thread
lamkina marked this conversation as resolved.
Outdated

---

## Workflow Options

### build.yaml

Docker-based build and test workflow using the `scritical/private-dev` image.

| Name | Type | Default | Description |
| :--- | :--- | :------ | :---------- |
| `TIMEOUT` | number | `120` | Runtime allowed for the job, in minutes |
| `GCC_CONFIG` | string | `""` | Path to GCC configuration file (from repository root) |
Comment thread
lamkina marked this conversation as resolved.
| `BUILD_SCRIPT` | string | `.github/build_real.sh` | Path to build script. Empty string skips this step |
| `TEST_SCRIPT` | string | `.github/test_real.sh` | Path to test script. Empty string skips this step |

**Required Secrets:**
| Name | Description |
| :--- | :---------- |
| `DOCKER_OAT` | Docker registry Organization Access Token |
Comment thread
lamkina marked this conversation as resolved.

---

### format-and-lint.yaml

Python formatting and linting using pre-commit with ruff.

| Name | Type | Default | Description |
| :--- | :--- | :------ | :---------- |
| `MCCABE` | boolean | `false` | Enable McCabe complexity check (pass/fail, max complexity = 10) |

**Configuration Override:** Create a `ruff.toml` in your repo with:
```toml
extend = "~/.config/ruff/ruff.toml"

# Local overrides here
[lint]
ignore = ["N802"]
```

---

### pypi.yaml

Publish Python packages to PyPI on tagged releases.

**Required Secrets:**
| Name | Description |
| :--- | :---------- |
| `PYPI_API_TOKEN` | PyPI API token for publishing |
Comment thread
lamkina marked this conversation as resolved.
Outdated

---

### tapenade.yaml

Run Tapenade automatic differentiation and check for uncommitted changes.

| Name | Type | Default | Description |
| :--- | :--- | :------ | :---------- |
| `TIMEOUT` | number | `10` | Runtime allowed for the job, in minutes |
| `TAPENADE_SCRIPT` | string | `.github/build_tapenade.sh` | Path to Tapenade build script |

Uses Tapenade version 3.16.
Comment thread
lamkina marked this conversation as resolved.
Outdated

---

### clang_format.yaml

C/C++ code formatting checks using clang-format.

| Name | Type | Default | Description |
| :--- | :--- | :------ | :---------- |
| `TIMEOUT` | number | `10` | Runtime allowed for the job, in minutes |

**Configuration Override:** Create a `.clang-format` file in your repo root.

---

### fprettify.yaml

Fortran 90 code formatting checks using fprettify.

| Name | Type | Default | Description |
| :--- | :--- | :------ | :---------- |
| `TIMEOUT` | number | `10` | Runtime allowed for the job, in minutes |

**Configuration Override:** Create a `.fprettify.rc` file in your repo root.

---

### isort.yaml

Python import sorting checks.

**Configuration Override:** Create a `.isort.cfg` file in your repo root with overrides. The global and local configs are merged automatically using `combine-config.py`.

---

### pylint.yaml

Python linting with pylint.

**Configuration Override:** Create a `.pylintrc` file in your repo root with overrides. The global and local configs are merged automatically using `combine-config.py`.

---

### mypy.yaml

Python type checking with mypy.

No configurable inputs. Uses Python 3.11.
Comment thread
lamkina marked this conversation as resolved.
Outdated

---

## Setting Up Workflows

### Step 1: Create Workflow File

Create `.github/workflows/ci.yaml` in your repository:

```yaml
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
uses: scritical/.github/.github/workflows/build.yaml@main
with:
GCC_CONFIG: config/defaults/config.LINUX_GFORTRAN.mk
BUILD_SCRIPT: .github/build_real.sh
TEST_SCRIPT: .github/test_real.sh
Comment thread
lamkina marked this conversation as resolved.
Outdated
secrets:
Comment thread
lamkina marked this conversation as resolved.
Outdated
DOCKER_OAT: ${{ secrets.DOCKER_OAT }}
Comment thread
lamkina marked this conversation as resolved.
Outdated

format-and-lint:
uses: scritical/.github/.github/workflows/format-and-lint.yaml@main

clang-format:
uses: scritical/.github/.github/workflows/clang_format.yaml@main

fprettify:
uses: scritical/.github/.github/workflows/fprettify.yaml@main
```

### Step 2: Write Build Script

Create `.github/build_real.sh` in your repository:

```bash
#!/bin/bash
set -e
cp $CONFIG_FILE config/config.mk
make
pip install .
```

### Step 3: Write Test Script

Create `.github/test_real.sh` in your repository:

```bash
#!/bin/bash
set -e
./input_files/get-input-files.sh
testflo -v . -n 1
```

### Step 4: Add Secrets

In your repository settings, add the required secrets:
Comment thread
lamkina marked this conversation as resolved.
Outdated
- `DOCKER_OAT` - Docker Organization Access Token for pulling private images

---

## PyPI Publishing
Comment thread
lamkina marked this conversation as resolved.
Outdated

For repositories that publish to PyPI, extend your workflow:

```yaml
name: CI

on:
push:
branches: [main]
tags:
- 'v*.*.*'
pull_request:
branches: [main]

jobs:
format-and-lint:
uses: scritical/.github/.github/workflows/format-and-lint.yaml@main

build:
uses: scritical/.github/.github/workflows/build.yaml@main
with:
GCC_CONFIG: config/defaults/config.LINUX_GFORTRAN.mk
secrets:
DOCKER_OAT: ${{ secrets.DOCKER_OAT }}

pypi:
needs: [format-and-lint, build]
uses: scritical/.github/.github/workflows/pypi.yaml@main
secrets:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
```

---

## Complex Builds

For repositories requiring both real and complex builds:

```yaml
jobs:
build-real:
uses: scritical/.github/.github/workflows/build.yaml@main
with:
GCC_CONFIG: config/defaults/config.LINUX_GFORTRAN.mk
BUILD_SCRIPT: .github/build_real.sh
TEST_SCRIPT: .github/test_real.sh
secrets:
Comment thread
lamkina marked this conversation as resolved.
Outdated
DOCKER_OAT: ${{ secrets.DOCKER_OAT }}

build-complex:
uses: scritical/.github/.github/workflows/build.yaml@main
with:
GCC_CONFIG: config/defaults/config.LINUX_GFORTRAN.mk
BUILD_SCRIPT: .github/build_complex.sh
TEST_SCRIPT: .github/test_complex.sh
secrets:
DOCKER_OAT: ${{ secrets.DOCKER_OAT }}
```

---

## Configuration Inheritance
Comment thread
lamkina marked this conversation as resolved.
Outdated

Several workflows support configuration inheritance/overrides:

| Tool | Method | Local Config File |
| :--- | :----- | :---------------- |
| Ruff | Native `extend` keyword | `ruff.toml` |
| Pylint | Merged via `combine-config.py` | `.pylintrc` |
| isort | Merged via `combine-config.py` | `.isort.cfg` |
| clang-format | Local file takes precedence | `.clang-format` |
| fprettify | Local file takes precedence | `.fprettify.rc` |

### Example: Ruff Override

```toml
# ruff.toml
extend = "~/.config/ruff/ruff.toml"

[lint]
ignore = ["N802", "N803"] # Allow uppercase function/argument names
```

### Example: Pylint Override

```ini
# .pylintrc (partial - only overrides)
[MESSAGES CONTROL]
disable = C0114,C0115

[FORMAT]
max-line-length = 150
```

---

## Adding Status Badge

Add a status badge to your README:

```markdown
![CI](https://github.com/scritical/REPO_NAME/actions/workflows/ci.yaml/badge.svg)
```
10 changes: 2 additions & 8 deletions .github/workflows/branch-name-check.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
name: Branch Name Check

on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- main
- 'client-*'
workflow_call:

jobs:
check-branch-name:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Check branch name for main
if: github.base_ref == 'main'
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
on:
workflow_call:
inputs:
TIMEOUT:
type: number
default: 120
description: "Timeout for the job in minutes"
GCC_CONFIG:
type: string
default: ""
description: "Path to GCC configuration file"
BUILD_SCRIPT:
type: string
default: ".github/build_real.sh"
Comment thread
lamkina marked this conversation as resolved.
description: "Path to build script"
TEST_SCRIPT:
type: string
default: ".github/test_real.sh"
description: "Path to test script"
secrets:
DOCKER_OAT:
required: true
description: "Docker registry Organization Access Token"

env:
SCRITICAL_HOMEDIR: /home/scriticaluser
DOCKER_TAG: u24-gcc-ompi-latest
Comment thread
lamkina marked this conversation as resolved.
Outdated

jobs:
build-and-test:
runs-on: ubuntu-24.04
timeout-minutes: ${{ inputs.TIMEOUT }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
Comment thread
lamkina marked this conversation as resolved.
Outdated

- name: Get repository name
id: repo
run: echo "name=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT

- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_OAT }}" | docker login -u scritical --password-stdin
Comment thread
lamkina marked this conversation as resolved.
Outdated

- name: Pull Docker image
run: docker pull scritical/private-dev:${{ env.DOCKER_TAG }}

- name: Start Docker container
run: |
REPO_NAME="${{ steps.repo.outputs.name }}"
docker run -t -d --name app \
--mount "type=bind,src=${{ github.workspace }},target=${{ env.SCRITICAL_HOMEDIR }}/mount/${REPO_NAME}" \
scritical/private-dev:${{ env.DOCKER_TAG }} /bin/bash

# Copy repo to working directory
docker exec app /bin/bash -c "rm -rf ${{ env.SCRITICAL_HOMEDIR }}/repos/${REPO_NAME} && mkdir -p ${{ env.SCRITICAL_HOMEDIR }}/repos/${REPO_NAME} && cp -a ${{ env.SCRITICAL_HOMEDIR }}/mount/${REPO_NAME}/. ${{ env.SCRITICAL_HOMEDIR }}/repos/${REPO_NAME}/"
Comment thread
lamkina marked this conversation as resolved.
Outdated

- name: Build
if: inputs.BUILD_SCRIPT != ''
run: |
REPO_NAME="${{ steps.repo.outputs.name }}"
docker exec \
-e CONFIG_FILE="${{ inputs.GCC_CONFIG }}" \
app /bin/bash -c ". ${{ env.SCRITICAL_HOMEDIR }}/.bashrc_scritical && cd ${{ env.SCRITICAL_HOMEDIR }}/repos/${REPO_NAME} && /bin/bash ${{ inputs.BUILD_SCRIPT }}"

- name: Test
if: inputs.TEST_SCRIPT != ''
run: |
REPO_NAME="${{ steps.repo.outputs.name }}"
docker exec \
-e AGENT_NAME="${{ runner.name }}" \
-e BUILD_REASON="${{ github.event_name }}" \
app /bin/bash -c ". ${{ env.SCRITICAL_HOMEDIR }}/.bashrc_scritical && cd ${{ env.SCRITICAL_HOMEDIR }}/repos/${REPO_NAME} && source ~/MPIOversubscribe.sh && /bin/bash ${{ inputs.TEST_SCRIPT }}"

- name: Cleanup
if: always()
run: docker stop app && docker rm app || true
Loading