Skip to content

Commit

Permalink
GHA: add merge_ok bits from other st2-auth repos
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Oct 21, 2024
1 parent ef8c891 commit f94031c
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/lint-and-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ jobs:
strategy:
fail-fast: false
matrix:
version:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Checkout repo
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
python-version: ${{ matrix.python-version }}

- name: Clone StackStorm/st2 repo
run: |
Expand All @@ -39,8 +41,36 @@ jobs:
sudo apt-get -y install python3-virtualenv
make requirements
- name: Run lint and tests (Python ${{ matrix.version }})
- name: Run lint and tests (Python ${{ matrix.python-version }})
run: |
make .lint
make .unit-tests
set_merge_ok:
name: Set Merge OK
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
needs:
- build-and-test-python
outputs:
merge_ok: ${{ steps.set_merge_ok.outputs.merge_ok }}
runs-on: ubuntu-latest
steps:
- id: set_merge_ok
run: echo 'merge_ok=true' >> ${GITHUB_OUTPUT}

merge_ok:
name: Merge OK
if: always()
needs:
- set_merge_ok
runs-on: ubuntu-latest
steps:
- run: |
merge_ok="${{ needs.set_merge_ok.outputs.merge_ok }}"
if [[ "${merge_ok}" == "true" ]]; then
echo "Merge OK"
exit 0
else
echo "Merge NOT OK"
exit 1
fi

0 comments on commit f94031c

Please sign in to comment.