Run all checks #1669
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: Run all checks | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: 'The git ref to build the package for' | |
| required: false | |
| default: '' | |
| type: string | |
| use_lkg: | |
| description: 'Whether to use the last known good versions of dependencies' | |
| required: false | |
| default: True | |
| type: boolean | |
| # nightly | |
| schedule: | |
| - cron: '0 0 * * *' | |
| # Only run once per PR, canceling any previous runs | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| # Precompute the ref if the workflow was triggered by a workflow dispatch rather than copying this logic repeatedly | |
| env: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || null }} | |
| # we want to use the LKG if that is explicitly requested, or if we're in a PR, but not a nightly run | |
| # the final `|| ''` is because env vars are always converted to strings and the string 'false' is truthy (!!) | |
| # (see https://github.com/orgs/community/discussions/25645) | |
| use_lkg: ${{ (github.event_name == 'workflow_dispatch' && inputs.use_lkg) || github.event_name == 'pull_request' || ''}} | |
| jobs: | |
| generate-reqs-per-env: | |
| name: Store requirements for LKG updates | |
| strategy: | |
| matrix: | |
| kind: [tests] | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
| include: | |
| # assign extras to all combinations | |
| - extras: "[plt,dowhy,ray]" | |
| # overwrite extras for python 3.13 only | |
| - extras: "[plt,dowhy]" | |
| python-version: '3.13' | |
| # explicitly add the two notebook extras | |
| - kind: notebooks-other | |
| os: ubuntu-latest | |
| python-version: '3.12' | |
| extras: "[plt,ray]" | |
| - kind: notebooks-customer | |
| os: ubuntu-latest | |
| python-version: '3.12' | |
| extras: "[plt,dowhy]" | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ env.ref }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| # check if we're running on windows | |
| run: ${{ runner.os == 'Windows' && 'irm https://astral.sh/uv/install.ps1 | iex' || 'curl -LsSf https://astral.sh/uv/install.sh | sh' }} | |
| - name: Compile econml dependencies | |
| run: uv pip compile pyproject.toml ${{ matrix.extras && format('--extra {0}', join(matrix.extras, ' --extra ')) || '' }} --verbose | |