From 94549c7ed20bc1df04837ff2ae927cf87d9462b9 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:08:29 +0200 Subject: [PATCH 01/29] Try a reusable workflow for pull requests --- .github/workflows/merge-demo.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/workflows/merge-demo.yml diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml new file mode 100644 index 0000000..6690056 --- /dev/null +++ b/.github/workflows/merge-demo.yml @@ -0,0 +1,9 @@ +name: Merge Demo +on: + pull_request: + +jobs: + Reuse-github-actions-demo: + runs-on: ubuntu-latest + steps: + - uses: ./.github/workflows/actions-demo.yml From ee8fb6e5859ad272b0ecc7832db858232face943 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:10:25 +0200 Subject: [PATCH 02/29] Check out repository before referring to files --- .github/workflows/merge-demo.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 6690056..3d75ef4 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -6,4 +6,6 @@ jobs: Reuse-github-actions-demo: runs-on: ubuntu-latest steps: + - name: Check out repository code + uses: actions/checkout@v3 - uses: ./.github/workflows/actions-demo.yml From 7c9f9fd8097fdde9c04dc4e6295b7a4a45f75981 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:13:29 +0200 Subject: [PATCH 03/29] The file extension seems unnecessary --- .github/workflows/merge-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 3d75ef4..9c6049f 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -8,4 +8,4 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v3 - - uses: ./.github/workflows/actions-demo.yml + - uses: ./.github/workflows/actions-demo From 2b57d4ebe31ab103be30148dbf0fbee3e9f4fbd8 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:14:52 +0200 Subject: [PATCH 04/29] List files in the workflows directory --- .github/workflows/merge-demo.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 9c6049f..dc5e25b 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -8,4 +8,7 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v3 - - uses: ./.github/workflows/actions-demo + - name: List files in the workflows dir + run: | + ls ${{ github.workspace }}/.github/workflows/ + - uses: ./.github/workflows/actions-demo.yml From 819a80cab34bb147f3edd1264f325855c5cb7ad0 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:19:01 +0200 Subject: [PATCH 05/29] Try the local directory --- .github/workflows/merge-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index dc5e25b..630e682 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -11,4 +11,4 @@ jobs: - name: List files in the workflows dir run: | ls ${{ github.workspace }}/.github/workflows/ - - uses: ./.github/workflows/actions-demo.yml + - uses: ./actions-demo.yml From f0870ade6e6f9417c82c247e8e864338deb7928f Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:20:13 +0200 Subject: [PATCH 06/29] Maybe you need to refer to the job? --- .github/workflows/merge-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 630e682..e4e62fb 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -11,4 +11,4 @@ jobs: - name: List files in the workflows dir run: | ls ${{ github.workspace }}/.github/workflows/ - - uses: ./actions-demo.yml + - uses: ./.github/workflows/Demo-github-actions From 254c1c77359c324ff11f821323ee71ca340fb4a7 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:26:55 +0200 Subject: [PATCH 07/29] Stop running actions-demo on push for now --- .github/workflows/actions-demo.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index bd38be2..ac410d3 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -1,7 +1,8 @@ name: Github Actions demo on: - push: workflow_call: +# push: + jobs: Demo-github-actions: runs-on: ubuntu-latest From e2ee4999040d8231cb97f8095cb83f45d0f729b4 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:28:06 +0200 Subject: [PATCH 08/29] actions-demo is not available on main --- .github/workflows/merge-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index e4e62fb..4418c54 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -11,4 +11,4 @@ jobs: - name: List files in the workflows dir run: | ls ${{ github.workspace }}/.github/workflows/ - - uses: ./.github/workflows/Demo-github-actions + - uses: ./.github/workflows/actions-demo.yml@pr-demo From acf86f1af4e21812865b648b1153b72f2ee782da Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:32:56 +0200 Subject: [PATCH 09/29] Put the reuse on the steps level --- .github/workflows/merge-demo.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 4418c54..6821435 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -11,4 +11,5 @@ jobs: - name: List files in the workflows dir run: | ls ${{ github.workspace }}/.github/workflows/ - - uses: ./.github/workflows/actions-demo.yml@pr-demo + actual-reuse: + uses: ./.github/workflows/actions-demo.yml@pr-demo From f746fefe332eb5091535463b66adc2f3d10bd396 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:33:40 +0200 Subject: [PATCH 10/29] Cannot specify version when calling local workflows --- .github/workflows/merge-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 6821435..1a9a0ed 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -12,4 +12,4 @@ jobs: run: | ls ${{ github.workspace }}/.github/workflows/ actual-reuse: - uses: ./.github/workflows/actions-demo.yml@pr-demo + uses: ./.github/workflows/actions-demo.yml From befa8df5bd337120c39b01ad1fc54cf4710b201a Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:34:36 +0200 Subject: [PATCH 11/29] Do we need the whole preamble then? --- .github/workflows/merge-demo.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 1a9a0ed..7afc239 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -3,13 +3,6 @@ on: pull_request: jobs: - Reuse-github-actions-demo: - runs-on: ubuntu-latest - steps: - - name: Check out repository code - uses: actions/checkout@v3 - - name: List files in the workflows dir - run: | - ls ${{ github.workspace }}/.github/workflows/ actual-reuse: + runs-on: ubuntu-latest uses: ./.github/workflows/actions-demo.yml From e872481bdb12d17f1997796a5d6916a9b16277c5 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:35:08 +0200 Subject: [PATCH 12/29] Maybe not even runs-on? --- .github/workflows/merge-demo.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 7afc239..6f65159 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -4,5 +4,4 @@ on: jobs: actual-reuse: - runs-on: ubuntu-latest uses: ./.github/workflows/actions-demo.yml From 5b4ec6ffa492ea6da5d904af608016c97fe08d9e Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:37:37 +0200 Subject: [PATCH 13/29] Break some tests --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index a837c93..941bd3f 100644 --- a/test.py +++ b/test.py @@ -167,4 +167,4 @@ def test_get_entry(holding_radial, turn, direct_radial, direct_reciprocal, inbou (251, 71, 252, False), ]) def test_is_clockwise_between(radial_a, radial_b, course, result): - assert is_clockwise_between(radial_a, radial_b, course) is result + assert is_clockwise_between(radial_a, radial_b, course) is not result From 1184ce3f36865b5ecab0a58754d99020ed2bb8f0 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 20:48:00 +0200 Subject: [PATCH 14/29] Publish testresults.xml --- .github/workflows/actions-demo.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index ac410d3..ce94fdb 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -25,3 +25,9 @@ jobs: - name: Run tests run: | venv/bin/pytest --junit-xml=testresults.xml test.py + - name: Upload pytest results + uses: actions/upload-artifact@v3 + with: + name: testresults.xml + path: testresults.xml + if: ${{ always() }} From e6d71b37c6772a865c1c87e5f7095a06da2f22b5 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 21:03:11 +0200 Subject: [PATCH 15/29] Add more tests --- .github/workflows/actions-demo.yml | 18 +++++++++++++++--- requirements.txt | 3 +++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index ce94fdb..e243e1b 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -17,17 +17,29 @@ jobs: - run: echo "Job status is ${{ job.status }}" - name: Install virtualenv run: | + pip3 install --upgrade pip pip3 install virtualenv - name: Set up virtualenv run: | virtualenv --python=python3 venv venv/bin/pip install -r requirements.txt - - name: Run tests + - name: Run pylint + - name: Run pytest run: | - venv/bin/pytest --junit-xml=testresults.xml test.py + venv/bin/pytest --junit-xml=testresults.xml --cov=main.py --cov-report=html --cov-fail-under=90 test.py + - name: Run pep8 + run: | + venv/bin/pep8 --max-line-length=120 main.py + continue-on-error: true + - name: Run pylint + run: | + venv/bin/pylint --max-line-length=120 main.py + continue-on-error: true - name: Upload pytest results uses: actions/upload-artifact@v3 with: name: testresults.xml - path: testresults.xml + path: | + testresults.xml + htmlcov if: ${{ always() }} diff --git a/requirements.txt b/requirements.txt index e079f8a..53515da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,4 @@ pytest +pytest-cov +pep8 +pylint From f5b84456a4315ee3069cd2c841f7d24ac5f588f1 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 21:05:50 +0200 Subject: [PATCH 16/29] Remove invalid step --- .github/workflows/actions-demo.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index e243e1b..2dc78ef 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -23,7 +23,6 @@ jobs: run: | virtualenv --python=python3 venv venv/bin/pip install -r requirements.txt - - name: Run pylint - name: Run pytest run: | venv/bin/pytest --junit-xml=testresults.xml --cov=main.py --cov-report=html --cov-fail-under=90 test.py From 6d891173b6dff638023559caf5e44c71982a0a59 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 21:07:49 +0200 Subject: [PATCH 17/29] Run pep8 and pylint before pytest --- .github/workflows/actions-demo.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index 2dc78ef..a1aff50 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -23,9 +23,6 @@ jobs: run: | virtualenv --python=python3 venv venv/bin/pip install -r requirements.txt - - name: Run pytest - run: | - venv/bin/pytest --junit-xml=testresults.xml --cov=main.py --cov-report=html --cov-fail-under=90 test.py - name: Run pep8 run: | venv/bin/pep8 --max-line-length=120 main.py @@ -34,6 +31,9 @@ jobs: run: | venv/bin/pylint --max-line-length=120 main.py continue-on-error: true + - name: Run pytest + run: | + venv/bin/pytest --junit-xml=testresults.xml --cov=main.py --cov-report=html --cov-fail-under=90 test.py - name: Upload pytest results uses: actions/upload-artifact@v3 with: From b7004a43415352a5604be1e43a0778d752f8f0a0 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 21:09:04 +0200 Subject: [PATCH 18/29] Refer to module instead of filename for coverage --- .github/workflows/actions-demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index a1aff50..5a7cc27 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -33,7 +33,7 @@ jobs: continue-on-error: true - name: Run pytest run: | - venv/bin/pytest --junit-xml=testresults.xml --cov=main.py --cov-report=html --cov-fail-under=90 test.py + venv/bin/pytest --junit-xml=testresults.xml --cov=main --cov-report=html --cov-fail-under=90 test.py - name: Upload pytest results uses: actions/upload-artifact@v3 with: From 513eefcef32269b4a6f577e55c18f11b6a941a59 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 21:13:56 +0200 Subject: [PATCH 19/29] Update artifact filename --- .github/workflows/actions-demo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index 5a7cc27..75bcb8a 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -34,10 +34,10 @@ jobs: - name: Run pytest run: | venv/bin/pytest --junit-xml=testresults.xml --cov=main --cov-report=html --cov-fail-under=90 test.py - - name: Upload pytest results + - name: Upload testresults and coverage uses: actions/upload-artifact@v3 with: - name: testresults.xml + name: testresults path: | testresults.xml htmlcov From 375247c29dcfbcce160031f229667e9fd981ab0e Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 21:14:50 +0200 Subject: [PATCH 20/29] Get rid of line-too-long errors --- main.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index dec5993..8ea3646 100644 --- a/main.py +++ b/main.py @@ -52,7 +52,8 @@ def is_clockwise_between(radial_a, radial_b, course): if radial_a < radial_b and reciprocal_course in range(radial_a, radial_b + 1): return True - elif radial_a > radial_b and (reciprocal_course in range(radial_a, 360 + 1) or reciprocal_course in range(1, radial_b + 1)): + elif radial_a > radial_b and (reciprocal_course in range(radial_a, 360 + 1) or + reciprocal_course in range(1, radial_b + 1)): return True else: return False @@ -78,7 +79,8 @@ def get_entry(holding_radial, turn, direct_radial, direct_reciprocal, inbound_co else: return Entries.TEARDROP else: - raise ValueError(f'Unhandled edge case: {holding_radial}, {turn.value}, {direct_radial}, {direct_reciprocal}, {inbound_course}') + raise ValueError(f'''Unhandled edge case: {holding_radial}, {turn.value}, {direct_radial}, ''' + f'''{direct_reciprocal}, {inbound_course}''') def quiz(args): @@ -99,7 +101,8 @@ def quiz(args): answer = None while answer not in [e.value for e in Entries]: print(80 * '-') - print(f'Choose entry method for holding on radial {holding_radial} with {turn.value} turn and arriving on course {inbound_course}.') + print(f'''Choose entry method for holding on radial {holding_radial} with {turn.value} turn ''' + f'''and arriving on course {inbound_course}.''') for entry in Entries: print(f' {entry.value} {entry.name}') @@ -136,7 +139,8 @@ def main(): calc_parser = subparsers.add_parser('calc', help='Calculator mode') calc_parser.add_argument('--inbound', type=int, required=True, help='Inbound course to the holding point') calc_parser.add_argument('--holding-radial', type=int, required=True, help='Hold radial as given by ATC or plate') - calc_parser.add_argument('--turn', type=str, default=Turns.RIGHT.value, choices=[t.value for t in Turns], help='Turn direction (defaults to right)') + calc_parser.add_argument('--turn', type=str, default=Turns.RIGHT.value, choices=[t.value for t in Turns], + help='Turn direction (defaults to right)') calc_parser.set_defaults(func=calc) args = parser.parse_args() From ce39e501a3beec4fc438de436e1c29a2d3bdc970 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 21:17:47 +0200 Subject: [PATCH 21/29] Remove extra whitespace because pep8 asks so nicely --- main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/main.py b/main.py index 8ea3646..fc86e35 100644 --- a/main.py +++ b/main.py @@ -37,7 +37,6 @@ def get_parallel_limits(holding_radial, turn): direct_radial = get_reciprocal(direct_reciprocal) - return direct_radial, direct_reciprocal From d1e2d362d704953ed65464d71b23d0b7c588f5d7 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 21:18:17 +0200 Subject: [PATCH 22/29] pep8 is now pycodestyle --- .github/workflows/actions-demo.yml | 4 ++-- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index 75bcb8a..6ab6978 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -23,9 +23,9 @@ jobs: run: | virtualenv --python=python3 venv venv/bin/pip install -r requirements.txt - - name: Run pep8 + - name: Run pycodestyle run: | - venv/bin/pep8 --max-line-length=120 main.py + venv/bin/pycodestyle --max-line-length=120 main.py continue-on-error: true - name: Run pylint run: | diff --git a/requirements.txt b/requirements.txt index 53515da..65c7dd2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ pytest pytest-cov -pep8 +pycodestyle pylint From 8b0760a6ec05946878bbdcf467b6ca995747027e Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Tue, 26 Jul 2022 21:19:17 +0200 Subject: [PATCH 23/29] Pycodestyle should be happy now --- .github/workflows/actions-demo.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index 6ab6978..f98fa76 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -26,7 +26,6 @@ jobs: - name: Run pycodestyle run: | venv/bin/pycodestyle --max-line-length=120 main.py - continue-on-error: true - name: Run pylint run: | venv/bin/pylint --max-line-length=120 main.py From ac169372b857684febc2b3da6a253f4c6f1a986d Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Wed, 27 Jul 2022 18:56:49 +0200 Subject: [PATCH 24/29] Some extra jobs --- .github/workflows/merge-demo.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 6f65159..add5682 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -5,3 +5,9 @@ on: jobs: actual-reuse: uses: ./.github/workflows/actions-demo.yml + report-status: + steps: + - run: echo "Job status is ${{ job.status }}" + report-revision: + steps: + - run: echo "Running from branch ${{ github.ref }} in repository ${{ github.repository }}" From 630431e655e0e680e89d351d72c4123693b027cc Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Wed, 27 Jul 2022 18:58:22 +0200 Subject: [PATCH 25/29] Runs on --- .github/workflows/merge-demo.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index add5682..d7c6ac4 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -6,8 +6,10 @@ jobs: actual-reuse: uses: ./.github/workflows/actions-demo.yml report-status: + runs-on: ubuntu-latest steps: - run: echo "Job status is ${{ job.status }}" report-revision: + runs-on: ubuntu-latest steps: - run: echo "Running from branch ${{ github.ref }} in repository ${{ github.repository }}" From b3729c12772986e596cf25f3884593658aa021d5 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Wed, 27 Jul 2022 18:59:56 +0200 Subject: [PATCH 26/29] Introduce workflow dependencies and sleeps --- .github/workflows/merge-demo.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index d7c6ac4..2bb5117 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -7,9 +7,12 @@ jobs: uses: ./.github/workflows/actions-demo.yml report-status: runs-on: ubuntu-latest + needs: actual-reuse steps: - run: echo "Job status is ${{ job.status }}" + - run: sleep 5 report-revision: runs-on: ubuntu-latest + needs: report-status steps: - run: echo "Running from branch ${{ github.ref }} in repository ${{ github.repository }}" From 27741ddbed7513caff48bcdd4f25d7165ecd3b7d Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Wed, 27 Jul 2022 19:02:08 +0200 Subject: [PATCH 27/29] Ignore failing tests for a moment --- .github/workflows/actions-demo.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index f98fa76..42f7007 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -33,6 +33,7 @@ jobs: - name: Run pytest run: | venv/bin/pytest --junit-xml=testresults.xml --cov=main --cov-report=html --cov-fail-under=90 test.py + continue-on-error: true - name: Upload testresults and coverage uses: actions/upload-artifact@v3 with: From 6ddd8ad7dbf1c2f9369106da41b57cea2b256f68 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Wed, 27 Jul 2022 19:03:22 +0200 Subject: [PATCH 28/29] Stop ignoring test failures and sleeping --- .github/workflows/actions-demo.yml | 1 - .github/workflows/merge-demo.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/actions-demo.yml b/.github/workflows/actions-demo.yml index 42f7007..f98fa76 100644 --- a/.github/workflows/actions-demo.yml +++ b/.github/workflows/actions-demo.yml @@ -33,7 +33,6 @@ jobs: - name: Run pytest run: | venv/bin/pytest --junit-xml=testresults.xml --cov=main --cov-report=html --cov-fail-under=90 test.py - continue-on-error: true - name: Upload testresults and coverage uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 2bb5117..85a8177 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -10,7 +10,6 @@ jobs: needs: actual-reuse steps: - run: echo "Job status is ${{ job.status }}" - - run: sleep 5 report-revision: runs-on: ubuntu-latest needs: report-status From c594eef327ee39fc1eec8206615a5360e8ffae34 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Wed, 27 Jul 2022 19:20:59 +0200 Subject: [PATCH 29/29] Try using a marketplace action --- .github/workflows/merge-demo.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/merge-demo.yml b/.github/workflows/merge-demo.yml index 85a8177..150315f 100644 --- a/.github/workflows/merge-demo.yml +++ b/.github/workflows/merge-demo.yml @@ -3,6 +3,18 @@ on: pull_request: jobs: + use-action: + runs-on: Ubuntu-latest + steps: + - name: First interaction + uses: actions/first-interaction@v1.1.0 + with: + # Token for the repository. Can be passed in using {{ secrets.GITHUB_TOKEN }} + repo-token: "{{ secrets.GITHUB_TOKEN }}" + # Comment to post on an individual's first issue + issue-message: "Welcome to the project!" + # Comment to post on an individual's first pull request + pr-message: "Thank you for your PR!" actual-reuse: uses: ./.github/workflows/actions-demo.yml report-status: