Move to dependency groups approach for pip installs
#36
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Workflow to run Fortran pre-processor checks on source | |
| name: Preprocessing | |
| 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/preprocessing.yml' | |
| - 'ftorch_tensor.f*' | |
| - 'ftorch_test_utils.f*' | |
| # 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: | |
| name: 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: | |
| - name: Checkout FTorch repository | |
| with: | |
| persist-credentials: true | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Setup Python | |
| uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6 | |
| with: | |
| python-version: '3.13' # Use 3.13 as no PyTorch wheels for 3.14 yet. | |
| - name: Install fypp, the Fortran pre-processor | |
| run: pip install --group preproc | |
| - name: Check ftorch_tensor.fypp matches ftorch_tensor.f90 | |
| run: | | |
| fypp src/ftorch_tensor.fypp src/temp.f90_temp | |
| if ! diff -q src/ftorch_tensor.f90 src/temp.f90_temp; then | |
| echo "Error: The code in ftorch_tensor.f90 does not match that expected from ftorch_tensor.fypp." | |
| echo "Please re-run fypp on ftorch_tensor.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 |