Nuclia Evaluation Library v1.0.0 #15
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: CI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'src/**' | |
- 'tests/**' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'src/**' | |
- 'tests/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: "Test" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: make install-no-cuda | |
- name: Run pre-checks | |
run: make lint | |
- name: Run tests | |
run: make test | |
- name: Get coverage | |
uses: orgoro/[email protected] | |
if: github.event_name == 'pull_request' | |
with: | |
coverageFile: coverage.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
thresholdAll: 0.9 | |
- name: Update and push coverage badge | |
# Only update the badge on the main branch | |
if: github.ref == 'refs/heads/main' | |
run: | | |
pip install genbadge[coverage] | |
genbadge coverage -i coverage.xml | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git clone --single-branch --branch gh-pages https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} gh-pages | |
mkdir -p gh-pages/badges | |
mv coverage-badge.svg gh-pages/badges/coverage.svg | |
cd gh-pages | |
git add badges/coverage.svg | |
git commit -m 'Update coverage badge' | |
git push origin gh-pages |