Skip to content

Commit

Permalink
Update and rename python-app.yml to ci.yml
Browse files Browse the repository at this point in the history
Adding options to save coverage data
For security reasons we will add the comment using a 2nd action I will create next
  • Loading branch information
e100 authored Jun 8, 2024
1 parent f428fe0 commit d0b5a56
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/python-app.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application
name: CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

permissions:
# Needed to save data for comment
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
Expand All @@ -38,3 +38,19 @@ jobs:
- name: Test with pytest
run: |
pytest
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}

- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v4
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly
name: python-coverage-comment-action
# If you use a different name, update COMMENT_FILENAME accordingly
path: python-coverage-comment-action.txt

0 comments on commit d0b5a56

Please sign in to comment.