ci: add testing and release cutting workflows #9
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
| on: | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| _VCPKG_: ${{ github.workspace }}/external/microsoft/vcpkg | |
| VCPKG_ROOT: ${{ github.workspace }}/external/microsoft/vcpkg | |
| VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
| VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/external/microsoft/vcpkg/bincache | |
| VCPKG_FEATURE_FLAGS: "dependencygraph" | |
| jobs: | |
| build-test: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| TRIPLET: x64-linux | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: "true" | |
| - uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
| core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
| - name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'" | |
| run: mkdir -p ${{ github.workspace }}/external/microsoft/vcpkg/bincache | |
| shell: bash | |
| - uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: "3.29.0" | |
| - name: Restore vcpkg | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ${{ env._VCPKG_ }} | |
| !${{ env._VCPKG_ }}/buildtrees | |
| !${{ env._VCPKG_ }}/packages | |
| !${{ env._VCPKG_ }}/downloads | |
| !${{ env._VCPKG_ }}/installed | |
| key: | | |
| ${{ env.TRIPLET }}-${{ hashFiles( '.git/modules/external/microsoft/vcpkg/HEAD' )}} | |
| - name: Configure | |
| env: | |
| CMAKE_VERBOSE_MAKEFILE: 1 | |
| VCPKG_DEBUG: 1 | |
| run: | | |
| echo "Configuring for triplet ${{ env.TRIPLET }}" | |
| TRIPLET=${{ env.TRIPLET }} make configure | |
| - name: Upload vcpkg buildtrees | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vcpkg-buildtrees-${{ env.TRIPLET }}-${{ github.sha }} | |
| path: external/microsoft/vcpkg/buildtrees/science-scipp | |
| retention-days: 1 | |
| - name: Build | |
| run: NPROC=1 make build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-${{ env.TRIPLET }}-${{ github.sha }} | |
| path: build | |
| retention-days: 1 | |
| - name: Run tests | |
| run: make test | |
| shell: bash |