zonbudusg checks #188
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: zonbudusg checks | |
| on: | |
| # run at 6 AM UTC every day | |
| schedule: | |
| - cron: '0 6 * * *' | |
| push: | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PIXI_BETA_WARNING_OFF: true | |
| DIST: dist-path | |
| PROGRAM_NAME: zonbudusg | |
| jobs: | |
| build: | |
| name: ${{ matrix.os }} ${{ matrix.compiler }} ${{ matrix.version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # gcc | |
| - {os: ubuntu-22.04, compiler: gcc, version: 13, shell: bash, release: no} | |
| - {os: macos-14, compiler: gcc, version: 13, shell: bash, release: yes} | |
| - {os: windows-2022, compiler: gcc, version: 13, shell: pwsh, release: no} | |
| # intel | |
| - {os: ubuntu-22.04, compiler: intel, version: "2025.0", shell: bash, release: yes} | |
| - {os: windows-2022, compiler: intel, version: "2025.0", shell: pwsh, release: yes} | |
| defaults: | |
| run: | |
| shell: ${{ matrix.shell }} | |
| steps: | |
| - name: Checkout zonbudusg | |
| uses: actions/checkout@v7 | |
| with: | |
| path: ${{ env.PROGRAM_NAME }} | |
| - 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.10.0 | |
| 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 | |
| # static link gfortran libs | |
| - name: Hide dylibs (macOS) | |
| if: runner.os == 'macOS' | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| run: | | |
| version="${{ matrix.version }}" | |
| brew_prefix="$(brew --prefix)" | |
| libpath="$brew_prefix/opt/gcc@$version/lib/gcc/$version" | |
| mv $libpath/libgcc_s.1.1.dylib $libpath/libgcc_s.1.1.dylib.bak | |
| mv $libpath/libgfortran.5.dylib $libpath/libgfortran.5.dylib.bak | |
| mv $libpath/libquadmath.0.dylib $libpath/libquadmath.0.dylib.bak | |
| mv $libpath/libstdc++.6.dylib $libpath/libstdc++.6.dylib.bak | |
| # static link libgcc | |
| - name: Set LDFLAGS (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| ldflags="$LDFLAGS -static-libgcc" | |
| echo "LDFLAGS=$ldflags" >> $GITHUB_ENV | |
| - name: Build single precision version of zonbudusg | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| run: | | |
| pixi run setup builddir | |
| pixi run build builddir | |
| - name: Build double precision version of zonbudusg | |
| working-directory: ${{ env.PROGRAM_NAME }} | |
| run: | | |
| pixi run setup builddir-dble -Ddouble=true | |
| pixi run build builddir-dble | |
| - name: Check architecture (macOS) | |
| working-directory: ${{ env.PROGRAM_NAME }}/bin | |
| if: runner.os == 'macOS' | |
| run: | | |
| otool -L zonbudusg | |
| otool -L zonbudusgdbl | |
| lipo -info zonbudusg | |
| lipo -info zonbudusgdbl | |
| - 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@v7 | |
| with: | |
| name: ${{ matrix.os }}-${{ matrix.compiler}}-${{ matrix.version }}-meson-log.txt | |
| path: ${{ env.PROGRAM_NAME }}/builddir/meson-logs/meson-log.txt | |
| - 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 src/ test/A.poly | |
| ls -lha *.zip | |
| - 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@v7 | |
| 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@v7 | |
| 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@v8 | |
| 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 }} |