tasks-scheduler 3b2 #502
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: Django CI | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: 'Test scenario tags' | |
required: false | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
name: Build and test | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Setup Python, Poetry and Dependencies" | |
uses: dsoftwareinc/setup-python-poetry-action@v1 | |
with: | |
python-version: '3.12' | |
poetry-version: '1.8.4' | |
- name: Run Tests | |
run: | | |
cd forum | |
poetry run coverage run manage.py test --no-logs | |
- name: Coverage report | |
id: coverage_report | |
shell: bash | |
run: | | |
mv forum/.coverage . | |
cp forum/.coveragerc . | |
echo 'REPORT<<EOF' >> $GITHUB_ENV | |
poetry run coverage report >> $GITHUB_ENV | |
echo 'EOF' >> $GITHUB_ENV | |
- uses: mshick/add-pr-comment@v2 | |
with: | |
message: | | |
Coverage report: | |
``` | |
${{ env.REPORT }} | |
``` | |
message-id: 'coverage' | |
allow-repeats: false | |
- name: json report | |
run: | | |
poetry run coverage json | |
echo "COVERAGE=$(jq '.totals.percent_covered_display|tonumber' coverage.json)" >> $GITHUB_ENV | |
- if: ${{ github.event_name == 'push' }} | |
name: Create Awesome Badge | |
uses: schneegans/[email protected] | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: ${{ secrets.COVERAGE_GIST_ID }} | |
filename: wiwik.json | |
label: Coverage | |
message: ${{ env.COVERAGE }}% | |
color: green |