Pixi CI #40
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
| # Copyright (c) ONNX Project Contributors | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Pixi CI | |
| on: | |
| schedule: | |
| # run weekly on Sunday 23:59 | |
| - cron: '29 23 * * SUN' | |
| push: | |
| paths: | |
| - '.github/workflows/pixi_build.yml' | |
| - 'CMakeLists.txt' | |
| - 'pixi.lock' | |
| - 'pixi.toml' | |
| permissions: | |
| contents: read | |
| issues: write # Needed to create an issue on failure | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| install-lint: | |
| name: Install and test (${{ matrix.os }}, ${{ matrix.environment }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| environment: | |
| - default | |
| - oldies | |
| steps: | |
| - name: Checkout branch | |
| uses: actions/checkout@v6.0.1 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up pixi | |
| uses: prefix-dev/setup-pixi@v0.9.3 | |
| with: | |
| environments: ${{ matrix.environment }} | |
| - name: Install repository | |
| run: pixi run -e ${{ matrix.environment }} install | |
| - name: gtests | |
| run: pixi run -e ${{ matrix.environment }} gtest | |
| - name: pytest | |
| run: pixi run -e ${{ matrix.environment }} pytest | |
| - name: Issue on failure | |
| uses: actions/github-script@v8 | |
| if: ${{ failure() && github.ref == 'refs/heads/main' }} | |
| with: | |
| script: | | |
| github.rest.issues.listForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| state: "open", | |
| labels: "[bot] pixi CI" | |
| }).then((issues) => { | |
| if (issues.data.length === 0){ | |
| github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: "Scheduled pixi CI failed", | |
| body: "The scheduled pixi-based CI failed. See https://github.com/${{ github.repository }}/actions/runs/${{github.run_id}} for details.", | |
| assignees: ["cbourjau"], | |
| labels: ["[bot] pixi CI"] | |
| }) | |
| } | |
| }); |