modpath-v7 compiler checks #75
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
| name: modpath-v7 compiler checks | |
| on: | |
| # run at 6 AM UTC every day | |
| schedule: | |
| - cron: '0 6 * * *' | |
| push: | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PIXI_BETA_WARNING_OFF: true | |
| DIST: dist-path | |
| PROGRAM_NAME: modpath-v7 | |
| jobs: | |
| build: | |
| name: Build and Test on ${{ matrix.os }} with ${{ matrix.compiler }} ${{ matrix.version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # test latest gcc | |
| - {os: ubuntu-latest, compiler: gcc, version: 13, shell: bash, release: no, xcode: none} | |
| - {os: macos-14, compiler: gcc, version: 13, shell: bash, release: yes, xcode: 14.3.1} | |
| - {os: windows-latest, compiler: gcc, version: 13, shell: pwsh, release: no, xcode: none} | |
| # test intel-classic | |
| - {os: ubuntu-22.04, compiler: intel-classic, version: 2021.7, shell: bash, release: no, xcode: none} | |
| - {os: macos-15-intel, compiler: intel-classic, version: 2021.6, shell: bash, release: yes, xcode: 16.4} | |
| # test previous gcc | |
| - {os: ubuntu-latest, compiler: gcc, version: 12, shell: bash, release: no, xcode: none} | |
| - {os: ubuntu-latest, compiler: gcc, version: 11, shell: bash, release: no, xcode: none} | |
| # test ifx | |
| - {os: ubuntu-22.04, compiler: intel, version: "2025.0", shell: bash, release: yes, xcode: none} | |
| - {os: windows-2022, compiler: intel, version: "2025.0", shell: pwsh, release: yes, xcode: none} | |
| defaults: | |
| run: | |
| shell: ${{ matrix.shell }} | |
| steps: | |
| - name: Checkout ${{ env.PROGRAM_NAME }} | |
| uses: actions/checkout@v5 | |
| with: | |
| path: ${{ env.PROGRAM_NAME }} | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| if: ${{ (runner.os == 'macOS') && (matrix.compiler == 'intel-classic') }} | |
| with: | |
| xcode-version: ${{ matrix.xcode }} | |
| - name: Setup ${{ matrix.compiler }} ${{ matrix.version }} on ${{ matrix.os }} | |
| uses: fortran-lang/setup-fortran@v1 | |
| with: | |
| compiler: ${{ matrix.compiler}} | |
| version: ${{ matrix.version }} | |
| - name: Setup pixi | |
| uses: prefix-dev/setup-pixi@v0.9.1 | |
| with: | |
| pixi-version: v0.41.4 | |
| manifest-path: "${{ env.PROGRAM_NAME }}/pixi.toml" | |
| - name: Set ostag | |
| shell: bash | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| id: ostag | |
| run: | | |
| echo "ostag=$(pixi run get-ostag)" >> $GITHUB_ENV | |
| - name: Create source zip file on Linux | |
| if: ${{ matrix.release == 'yes' && runner.os == 'Linux' }} | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| run: | | |
| zip -r ${{ env.PROGRAM_NAME }}_source.zip meson.build source/ examples/ | |
| ls -lha *.zip | |
| - name: Build ${{ env.PROGRAM_NAME }} | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| run: | | |
| pixi run setup | |
| pixi run build | |
| - name: Show build log | |
| if: failure() | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| run: cat builddir/meson-logs/meson-log.txt | |
| - name: Upload build log | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: meson-log.txt | |
| path: ${{ env.PROGRAM_NAME }}/builddir/meson-logs/meson-log.txt | |
| - name: Unit test ${{ env.PROGRAM_NAME }} | |
| if: success() | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| run: | | |
| pixi run test | |
| - name: Create zip file on MacOS and Linux | |
| if: ${{ matrix.release == 'yes' && runner.os != 'Windows' }} | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| run: | | |
| zip -r -j ${ostag}.zip bin/ | |
| ls -lha *.zip | |
| - name: Create zip file on Windows | |
| if: ${{ matrix.release == 'yes' && runner.os == 'Windows' }} | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| run: | | |
| $ZipFileName = "$env:ostag.zip" | |
| Compress-Archive -Path "bin\*" -DestinationPath $ZipFileName | |
| ls *.zip | |
| - name: Upload distribution archive | |
| if: matrix.release == 'yes' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.DIST }}-${{ matrix.os }} | |
| path: ${{ env.PROGRAM_NAME }}/*.zip | |
| release: | |
| name: Make release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v5 | |
| with: | |
| path: ${{ env.PROGRAM_NAME }} | |
| - name: Extract version number from the main meson.build file | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| run: | | |
| echo "PROGRAM_VERSION=$(grep -oE "([0-9]{1,}\.)+[0-9]{1,}" meson.build | head -n 1)" >> $GITHUB_ENV | |
| - name: Download distribution | |
| uses: actions/download-artifact@v5 | |
| with: | |
| pattern: ${{ env.DIST }}* | |
| merge-multiple: true | |
| path: ${{ env.DIST }} | |
| - name: List distribution files | |
| run: ls -l ${{ env.DIST }} | |
| # create new release if manual trigger | |
| - name: Create release | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: v${{ env.PROGRAM_VERSION }} | |
| name: "${{ env.PROGRAM_NAME }} executables" | |
| artifacts: "${{ env.DIST }}/*" | |
| draft: false | |
| allowUpdates: true | |
| token: ${{ secrets.GITHUB_TOKEN }} |