Skip to content

Commit d1b8b63

Browse files
authored
Bring in branch name dynamically
1 parent 3ffc5ba commit d1b8b63

1 file changed

Lines changed: 32 additions & 18 deletions

File tree

.github/workflows/tests.yml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
name: Tests
22

33
on:
4-
workflow_dispatch: # this is unique for external triggering by another repo
5-
push:
6-
branches: # Run tests when commits are pushed to these branches in your repo
7-
- main
8-
- master
9-
- develop
10-
- dev/*
11-
pull_request: # Run tests when pull requests are made on these branches in your repo
12-
branches:
13-
- main
14-
- master
15-
- develop
16-
- dev/*
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'Branch to test against (e.g., 3.3.x, 4.0.x, master)'
8+
required: false
9+
default: '3.3.x'
10+
11+
push:
12+
branches:
13+
- main
14+
- master
15+
- develop
16+
- dev/*
17+
pull_request:
18+
branches:
19+
- main
20+
- master
21+
- develop
22+
- dev/*
1723

1824
jobs:
19-
call-tests:
20-
name: Extension tests
21-
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
22-
with:
23-
EXTNAME: acme/demo # Your extension vendor/package name
25+
call-tests-phpBB3:
26+
if: ${{ (github.event_name != 'workflow_dispatch' || github.event.inputs.branch == '' || github.event.inputs.branch == '3.3.x') }}
27+
name: Tests for 3.3.x
28+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x
29+
with:
30+
EXTNAME: acme/demo
31+
32+
call-tests-phpBB4:
33+
if: ${{ github.event.inputs.branch == 'master' }}
34+
name: Tests for 4.0.x
35+
uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@master
36+
with:
37+
EXTNAME: acme/demo

0 commit comments

Comments
 (0)