set batch to highmem workers slight job creation reorder #3593
Workflow file for this run
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: Test | |
on: | |
# Building on pull-requests, manual dispatch, and pushes to main; but restricting | |
# publishing only to main pushes and manual dispatch with `if`s in specific steps. | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: "true" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install | |
run: pip install .[test] | |
- name: Run unit tests | |
id: runtests | |
timeout-minutes: 20 | |
run: | | |
PYTHONPATH=$PWD/gnomad_methods:$PWD/seqr-loading-pipelines \ | |
coverage run -m pytest -n auto test --junitxml=test-execution.xml | |
rc=$? | |
coverage xml | |
echo "rc=$rc" >> $GITHUB_OUTPUT | |
- name: 'Save coverage report as an Artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: ./coverage.xml | |
- name: 'Save execution report as an Artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: execution-report | |
path: ./test-execution.xml | |
- name: "Upload coverage reports to Codecov" | |
uses: codecov/codecov-action@v4.5.0 | |
with: | |
files: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Fail if unit tests are not passing | |
if: ${{ steps.runtests.outputs.rc != 0}} | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.setFailed('Unittests failed with rc = ${{ steps.runtests.outputs.rc }}') | |
sonarqube: | |
name: SonarQube scan | |
runs-on: ubuntu-latest | |
needs: test | |
environment: production | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
# Download the coverage report artifact | |
- name: 'Download coverage and execution report' | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: '*-report' | |
# Perform the SonarQube scan | |
- uses: sonarsource/sonarqube-scan-action@master | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
# Optional: Fail the job if Quality Gate is red | |
# If you wish to fail your job when the Quality Gate is red, uncomment the | |
# following lines. This would typically be used to fail a deployment. | |
# - uses: sonarsource/sonarqube-quality-gate-action@master | |
# timeout-minutes: 5 | |
# env: | |
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |