Divide up integration tests #1214
This file contains 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: Python package tests | |
on: | |
push: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
schedule: | |
- cron: "0 12 * * 1" | |
pull_request_target: | |
types: [opened, synchronize, reopened, ready_for_review] | |
jobs: | |
setup-test-dir: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup test dir | |
run: | | |
export TEST_DIR="tests/unit" | |
# if github action is not a pull request, then run all tests | |
if [[ ${{ github.event_name }} != 'pull_request' ]]; then | |
export TEST_DIR="tests" | |
fi | |
# print out so we can see | |
echo $TEST_DIR | |
call-run-python-tests: | |
needs: setup-test-dir | |
uses: openclimatefix/.github/.github/workflows/python-test.yml@issue/pip-all | |
with: | |
# pytest-cov looks at this folder | |
pytest_cov_dir: "quartz_solar_forecast" | |
os_list: '["ubuntu-latest"]' | |
python-version: "['3.11']" | |
extra_commands: echo "HF_TOKEN=${{ vars.HF_TOKEN }}" > .env | |
pytest_numcpus: '1' | |
test_dir: echo $TEST_DIR |