Skip to content

Commit 273de61

Browse files
authored
Merge pull request #2 from PowerGridModel/feature/add-test-workflow
testing: add test workflow for composite action
2 parents 91cdc18 + d79b098 commit 273de61

4 files changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
2+
#
3+
# SPDX-License-Identifier: MPL-2.0
4+
5+
name: Check Blocking Labels
6+
7+
on:
8+
# run pipeline on pull request
9+
pull_request:
10+
types:
11+
- opened
12+
- synchronize
13+
- labeled
14+
- unlabeled
15+
# run pipeline on merge queue
16+
merge_group:
17+
# run this workflow manually from the Actions tab
18+
workflow_dispatch:
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}-blocking-labels
22+
cancel-in-progress: true
23+
24+
jobs:
25+
check-blocking-labels:
26+
runs-on: ubuntu-latest
27+
steps:
28+
29+
- name: do-not-merge
30+
if: contains(github.event.pull_request.labels.*.name, 'do-not-merge')
31+
run: |
32+
echo "This pull request should not be merged (do-not-merge)"
33+
exit 1
34+
35+
- name: merge-target-first
36+
if: contains(github.event.pull_request.labels.*.name, 'merge-target-first')
37+
run: |
38+
echo "The target branch of this PR should be merged first (merge-target-first)"
39+
exit 2
40+
41+
- name: needs-unit-tests
42+
if: contains(github.event.pull_request.labels.*.name, 'needs-unit-tests')
43+
run: |
44+
echo "This pull request needs (more) unit tests before it may be merged (needs-unit-tests)"
45+
exit 3

.github/workflows/test-action.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
2+
#
3+
# SPDX-License-Identifier: MPL-2.0
4+
5+
name: Test the Action
6+
7+
on:
8+
# run pipeline on push event of main branch
9+
push:
10+
branches:
11+
- main
12+
# run pipeline on pull request
13+
pull_request:
14+
# run pipeline on merge queue
15+
workflow_dispatch:
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}-test-action
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test-pgm-version-bump:
23+
runs-on: ubuntu-24.04
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Set PyPI Version
28+
uses: ./
29+
30+
- name: Show latest version
31+
run: cat PYPI_VERSION

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0

VERSION.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
2+
3+
SPDX-License-Identifier: MPL-2.0

0 commit comments

Comments
 (0)