Fetching form Zenodo updates #2444
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: CI | |
| on: | |
| # GitHub has started calling new repo's first branch "main" https://github.com/github/renaming | |
| # The cookiecutter uses the "--initial-branch" flag when it runs git-init | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "main" | |
| pull_request: | |
| branches: | |
| - "main" | |
| schedule: | |
| # Weekly tests run on main by default: | |
| # Scheduled workflows run on the latest commit on the default or base branch. | |
| # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) | |
| - cron: "0 0 * * 0" | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| test: | |
| name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| python-version: ["3.10", "3.11", "3.12"] | |
| include: | |
| - os: ubuntu-latest | |
| n_procs: auto | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Additional info about the build | |
| run: | | |
| uname -a | |
| df -h | |
| ulimit -a | |
| # More info on options: https://github.com/marketplace/actions/provision-with-micromamba | |
| - uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| environment-file: devtools/conda-envs/test_env.yaml | |
| cache-environment: true | |
| cache-downloads: true | |
| create-args: >- | |
| python=${{ matrix.python-version }} | |
| if : matrix.os == 'ubuntu-latest' | |
| - uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| environment-file: devtools/conda-envs/test_env_mac.yaml | |
| cache-environment: true | |
| cache-downloads: true | |
| create-args: >- | |
| python=${{ matrix.python-version }} | |
| if: matrix.os != 'ubuntu-latest' | |
| - name: Install package | |
| # conda setup requires this special shell | |
| run: | | |
| python -m pip install . --no-deps | |
| python -m pip install -e ./modelforge-curate --no-deps | |
| micromamba list | |
| - name: Cache Test Dataset | |
| id: cache-dataset | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/modelforge_testing_dataset_cache | |
| key: ${{ runner.os }}-${{ matrix.python-version }}-modelforge-dataset-cache- | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.python-version }}-modelforge-dataset-cache- | |
| # since the underlying code itself will not redownload if files are present | |
| # I think regardless of the state we should just run the script | |
| # that may be the best way to ensure if we change the training datasets new will be generated | |
| - name: Fetch Test Dataset Cache | |
| if: steps.cache-dataset.outputs.cache-hit == 'true' | |
| run: | | |
| echo "using previously cached test datasets" | |
| #python modelforge/tests/fetch_test_datasets.py | |
| - name: Generate Dataset Cache | |
| if: steps.cache-dataset.outputs.cache-hit != 'true' | |
| run: | | |
| echo "downloading test datasets" | |
| python modelforge/tests/fetch_test_datasets.py | |
| - name: Run tests | |
| # conda setup requires this special shell | |
| run: | | |
| pytest -n 4 --dist loadgroup -v --cov=modelforge --cov-report=xml --color=yes --durations=50 modelforge/tests/ | |
| # pytest -n ${{matrix.n_procs}} --dist loadgroup -v --cov=modelforge --cov-report=xml --color=yes --durations=50 modelforge/tests/ | |
| - name: CodeCov | |
| uses: codecov/codecov-action@v4 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| if: ${{ github.event != 'schedule' }} # Don't upload results on scheduled runs | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: ./coverage.xml | |
| flags: unittests | |
| name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} |