Skip to content

Commit

Permalink
Merge pull request #127 from ElDavoo/workflow
Browse files Browse the repository at this point in the history
workflow update
  • Loading branch information
ElDavoo authored May 24, 2024
2 parents 5cd2ed6 + bc5a69c commit c0cf95b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: "CodeQL"

on:
push:
branches: [ main ]
branches: [ '*' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: Lint and test
name: "Lint, tests, coverage"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
push:
branches:
- '*'
pull_request:
branches:
- main

permissions:
contents: read

jobs:
build:
job:

runs-on: ubuntu-latest
strategy:
Expand All @@ -23,11 +25,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest codecov pytest-cov coveralls
python -m pip install .
python -m pip install -e .[test]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -36,17 +39,10 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python -m pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=./
- name: Pytest-cov
uses: lpenz/ghaction-pytest-cov@v1
- name: Report Coveralls (Linux)
if: startsWith(runner.os, 'Linux')
run: curl -sL https://coveralls.io/coveralls-linux.tar.gz | tar -xz && ./coveralls
python -m pytest --cov
- name: Coveralls
uses: coverallsapp/github-action@v2
if: github.event_name != 'pull_request'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c0cf95b

Please sign in to comment.