Merge pull request #733 from MiraGeoscience/DEVOPS-989-github-PR-action #127
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: pytest on Windows | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: | |
| - develop | |
| - main | |
| - release/** | |
| - feature/** | |
| - hotfix/** | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| - release/** | |
| - feature/** | |
| - hotfix/** | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| pytest: | |
| name: pytest (Windows) | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python_ver: ['3.10'] | |
| defaults: | |
| run: | |
| shell: powershell | |
| runs-on: windows-latest | |
| env: | |
| PYTHONUTF8: 1 | |
| CONDA_CHANNEL_PRIORITY: strict | |
| PIP_NO_DEPS: 1 # all dependencies are installed from conda | |
| CONDA_LOCK_ENV_FILE: environments/py-${{ matrix.python_ver }}-win-64-dev.conda.lock.yml | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Setup conda env | |
| uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| environment-file: ${{ env.CONDA_LOCK_ENV_FILE }} | |
| environment-name: test_env | |
| init-shell: powershell | |
| cache-downloads: true | |
| - name: pytest | |
| run: pytest --cov --cov-report=xml | |
| - name: Codecov | |
| if: ${{ success() && matrix.python_ver == '3.10' }} | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| name: GitHub | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} |