Skip to content

Merge pull request #2662 from cptanalatriste/258-update-guacamole-use… #3772

Merge pull request #2662 from cptanalatriste/258-update-guacamole-use…

Merge pull request #2662 from cptanalatriste/258-update-guacamole-use… #3772

Workflow file for this run

---
name: Test code
# Run workflow on PRs and pushes to matching branches
on: # yamllint disable-line rule:truthy
push:
branches: [develop, latest]
pull_request:
jobs:
test_python:
runs-on: ubuntu-latest
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for pushing data to the
# python-coverage-comment-action branch, and for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: 3.12
- name: Install hatch
run: pip install virtualenv==20.39.0 hatch==1.16.3
# Temporary workaround. virtualenv==21.0.0 breaks the GH Action.
- name: Test Python
run: hatch run test:test-coverage
# For security reasons, PRs created from forks cannot generate PR comments directly
# (see https://securitylab.github.com/research/github-actions-preventing-pwn-requests/).
# Instead we need to trigger another workflow after this one completes.
- name: Generate coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
# Save the coverage comment for later use
# See https://github.com/py-cov-action/python-coverage-comment-action/blob/main/README.md
- name: Save coverage comment as an artifact
uses: actions/upload-artifact@v7
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
name: python-coverage-comment-action
path: python-coverage-comment-action.txt