fixing doc compilation #8
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: Run the tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| env: | |
| PREFIX_WINDOWS: C:\Miniconda3\envs\cocofest | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| shard: [1, 2] | |
| name: Tests on ${{ matrix.os }}-shard ${{ matrix.shard }} | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Set prefix windows | |
| run: | | |
| echo "PREFIX=${{ env.PREFIX_WINDOWS }}" >> $GITHUB_ENV | |
| if: matrix.os == 'windows-latest' | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup environment | |
| uses: conda-incubator/setup-miniconda@v2 | |
| with: | |
| miniforge-version: 24.11.3-2 | |
| use-mamba: true | |
| activate-environment: cocofest | |
| environment-file: environment.yml | |
| - name: Print mamba info | |
| run: | | |
| conda info | |
| conda list | |
| - name: Install cocofest with dev dependencies | |
| run: pip install -e ".[dev]" | |
| - name: Run tests with code coverage | |
| run: pytest -v --color=yes --cov-report term-missing --cov=cocofest --cov-report=xml:coverage.xml tests/shard${{ matrix.shard }} | |
| - name: Archive coverage report | |
| id: archive | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-${{ matrix.os }}-${{ matrix.shard }} | |
| path: | | |
| coverage.xml | |
| .coverage | |
| if-no-files-found: error | |
| include-hidden-files: true | |
| merge-coverage: | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Set prefix windows | |
| run: | | |
| echo "PREFIX=${{ env.PREFIX_WINDOWS }}" >> $GITHUB_ENV | |
| if: matrix.os == 'windows-latest' | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup environment | |
| uses: conda-incubator/setup-miniconda@v2 | |
| with: | |
| miniforge-version: 24.11.3-2 | |
| use-mamba: true | |
| activate-environment: cocofest | |
| environment-file: environment.yml | |
| - name: Print mamba info | |
| run: | | |
| conda info | |
| conda list | |
| - name: Install extra dependencies | |
| run: pip install coverage | |
| - name: Download coverage artifacts for this OS | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: coverage-${{ matrix.os }}-* | |
| - name: Rename coverage files | |
| run: | | |
| for shard in {1,2}; do | |
| mv coverage-${{ matrix.os }}-${shard}/coverage.xml coverage${shard}.xml | |
| mv coverage-${{ matrix.os }}-${shard}/.coverage* .coverage${shard} | |
| done | |
| - name: Show current dir content | |
| run: pwd; ls -a -l | |
| - name: Merge coverage reports | |
| run: coverage combine .coverage1 .coverage2 | |
| - name: Show current dir content with new .coverage file | |
| run: pwd; ls -a | |
| - name: Generate XML report | |
| run: | | |
| coverage xml | |
| coverage report -m | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| file: ./coverage.xml | |
| flags: unittests | |
| fail_ci_if_error: true | |
| verbose: true |