Skip to content

ci: pin Python version in CI - test suite and static-analysis. #556

ci: pin Python version in CI - test suite and static-analysis.

ci: pin Python version in CI - test suite and static-analysis. #556

Workflow file for this run

# Workflow to run Fortran pre-processor checks on source
name: Fypp checks
on:
# Triggers the workflow on pushes to the "main" branch, i.e., PR merges
push:
branches: [ "main" ]
# Triggers the workflow on pushes to open pull requests with Fortran changes
pull_request:
paths:
- '.github/workflows/fypp_checks.yml'
- '**.fypp'
- '**.f90'
- '**.F90'
- '**.pf'
# Cancel jobs running if new commits are pushed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# Write permissions are not required
permissions: {}
# Workflow run - one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "fypp-checks"
fypp-checks:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Terminate the job if it runs for more than 5 minutes
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install fypp
- name: Check ftorch.fypp matches ftorch.F90
run: |
fypp src/ftorch.fypp src/temp.F90_temp
if ! diff -q src/ftorch.F90 src/temp.F90_temp; then
echo "Error: The code in ftorch.F90 does not match that expected from ftorch.fypp."
echo "Please re-run fypp on ftorch.fypp to ensure consistency and re-commit."
exit 1
else
exit 0
fi
- name: Check ftorch_test_utils.fypp matches ftorch_test_utils.f90
run: |
fypp src/ftorch_test_utils.fypp src/temp.f90_temp
if ! diff -q src/ftorch_test_utils.f90 src/temp.f90_temp; then
echo "Error: The code in ftorch_test_utils.f90 does not match that expected from ftorch_test_utils.fypp."
echo "Please re-run fypp on ftorch_test_utils.fypp to ensure consistency and re-commit."
exit 1
else
exit 0
fi