-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split test workflows for dev branch and prs; add step to compare pr t…
…ests with latest from dev
- Loading branch information
Showing
2 changed files
with
67 additions
and
10 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# 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 - PR | ||
|
||
on: | ||
pull_request: | ||
branches: [ "dev" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.7.x | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.7" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Test with unittest | ||
run: | | ||
python -m unittest discover Tests/test_NAL/ -p "test_*.py" -v &> output-pr.txt | ||
- name: Download workflow artifact | ||
uses: dawidd6/[email protected] | ||
with: | ||
workflow: python-app-dev.yml | ||
name: test-report | ||
|
||
- name: Setup Node (for diff) | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- run: npm install -g diff2html-cli | ||
|
||
- name: Compare test results | ||
run: | | ||
diff -u ./test-report/output-dev.txt output-pr.txt | diff2html -i stdin -F test-diff.html | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-diff | ||
path: ./test-diff.html | ||
|
||
|