Update shell scripts to improve consistency #286
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
| name: CI Pipeline | |
| on: | |
| push: | |
| branches: main | |
| pull_request: | |
| branches: main | |
| jobs: | |
| check-formatting: | |
| name: Check formatting | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v25 | |
| - run: nix develop -ic scripts/check-format.sh | |
| check-static-analyzer: | |
| name: Check static analysis | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v25 | |
| - run: nix develop -ic cmake --preset unix | |
| - run: nix develop -ic scripts/check-lint.sh | |
| check-documentation: | |
| name: Check documentation | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v25 | |
| - run: curl -L -O https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/v2.4.0/doxygen-awesome.css | |
| - run: curl -L -O https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/v2.4.0/doxygen-awesome-sidebar-only.css | |
| - run: nix develop -ic scripts/check-documentation.sh | |
| install: | |
| name: Install library | |
| needs: | |
| - check-formatting | |
| - check-static-analyzer | |
| - check-documentation | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: cmake --preset base -D CMAKE_INSTALL_PREFIX=install | |
| - run: cmake --build --preset base --target install | |
| # Upload installation for example-config | |
| - uses: actions/upload-artifact@v4 | |
| with: {name: install, path: "install"} | |
| example-config: | |
| name: Check config | |
| needs: install | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Download installation | |
| - uses: actions/download-artifact@v4 | |
| with: {name: install, path: "install"} | |
| - run: cmake -S cmake/examples/config -B build -D CMAKE_INSTALL_PREFIX=install | |
| - run: cmake --build build | |
| - run: ./build/example-config | |
| example-submodule: | |
| name: Check submodule | |
| needs: install | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: cmake -S cmake/examples/submodule -B build | |
| - run: cmake --build build | |
| - run: ./build/example-submodule | |
| example-include: | |
| name: Check include | |
| needs: install | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: cmake -S cmake/examples/include -B build | |
| - run: cmake --build build | |
| - run: ./build/example-include | |
| test-unit: | |
| name: Run unit tests | |
| needs: | |
| - example-config | |
| - example-submodule | |
| - example-include | |
| strategy: | |
| matrix: | |
| build: [Release, Debug] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: cmake --preset unix -D CMAKE_BUILD_TYPE=${{ matrix.build }} | |
| - run: cmake --build --preset unix --target tests | |
| - run: ctest --preset unix | |
| build-tools: | |
| name: Build tools library | |
| needs: test-unit | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, macos-14, windows-2022] | |
| arch: [Scalar, SSE, AVX, ARM] | |
| build: [Release, Debug] | |
| exclude: | |
| - {os: ubuntu-24.04, arch: ARM} | |
| - {os: macos-14, arch: Scalar} | |
| - {os: macos-14, arch: SSE} | |
| - {os: macos-14, arch: AVX} | |
| - {os: windows-2022, arch: ARM} | |
| include: | |
| - {os: ubuntu-24.04, preset: unix, save: true} | |
| - {os: macos-14, preset: unix, save: true} | |
| - {os: windows-2022, preset: windows} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: cmake --preset ${{ matrix.preset }} -D OPENQMC_ARCH_TYPE=${{ matrix.arch }} -D CMAKE_BUILD_TYPE=${{ matrix.build }} | |
| - run: cmake --build --preset ${{ matrix.preset }} | |
| - run: tar -czvf build.tar.gz build | |
| if: ${{ matrix.save }} | |
| # Upload tools build for test-generate | |
| - uses: actions/upload-artifact@v4 | |
| with: {name: "${{ matrix.build }}-${{ matrix.arch }}", path: build.tar.gz} | |
| if: ${{ matrix.save }} | |
| pre-test-generate: | |
| name: Pre generate reference data | |
| needs: build-tools | |
| strategy: | |
| matrix: | |
| sampler: [pmj, sobol, lattice] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| # Download tools build | |
| - uses: actions/download-artifact@v4 | |
| with: {name: Release-Scalar} | |
| - run: tar -xzvf build.tar.gz | |
| - run: ./build/src/tools/cli/generate ${{ matrix.sampler }} > data | |
| # Upload sample data for test-generate | |
| - uses: actions/upload-artifact@v4 | |
| with: {name: "${{ matrix.sampler }}", path: data} | |
| test-generate: | |
| name: Run generate | |
| needs: pre-test-generate | |
| strategy: | |
| matrix: | |
| os: [ubuntu-24.04, macos-14] | |
| arch: [Scalar, SSE, AVX, ARM] | |
| build: [Release, Debug] | |
| sampler: [pmj, sobol, lattice] | |
| exclude: | |
| - {os: ubuntu-24.04, arch: ARM} | |
| - {os: macos-14, arch: Scalar} | |
| - {os: macos-14, arch: SSE} | |
| - {os: macos-14, arch: AVX} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| # Download tools build | |
| - uses: actions/download-artifact@v4 | |
| with: {name: "${{ matrix.build }}-${{ matrix.arch }}"} | |
| # Download sample data | |
| - uses: actions/download-artifact@v4 | |
| with: {name: "${{ matrix.sampler }}"} | |
| - run: tar -xzvf build.tar.gz | |
| - run: ./build/src/tools/cli/generate ${{ matrix.sampler }} > output | |
| - run: diff output data |