|
| 1 | +# https://docs.github.com/actions/using-workflows/about-workflows |
| 2 | +# https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions |
| 3 | + |
1 | 4 | name: CI-build |
2 | 5 |
|
3 | | -# This workflow should trigger in the following cases: |
4 | | -# - The commit is any push in any branch in the repo |
5 | | -# - The commit is a published PR from anyone else |
6 | | -# |
7 | | -# This setup is done to avoid duplicate runs for the same exact commits, for cases when |
8 | | -# the PR is done from a branch in this repo, which would already trigger the "push" |
9 | | -# condition. This way, only PRs from forks will actually trigger the workflow. |
10 | | -# |
11 | | -# Because we can't really check these conditions from the global triggers here, they are |
12 | | -# added to the two root jobs below instead. If canceled, the whole workflow will stop. |
13 | | -on: [push, pull_request] |
| 6 | +# Controls when the action will run. |
| 7 | +on: |
| 8 | + |
| 9 | + # Triggers the workflow on push or PR events, but only for the 'main', development, or release branches |
| 10 | + push: |
| 11 | + branches: [ main, 'dev/*', 'rel/*' ] |
| 12 | + pull_request: |
| 13 | + branches: [ main, 'dev/*' ] |
| 14 | + |
| 15 | + # Allows running this workflow manually from the 'Actions' tab |
| 16 | + workflow_dispatch: |
| 17 | + merge_group: |
14 | 18 |
|
15 | 19 | env: |
16 | 20 | IS_MAIN: ${{ github.ref == 'refs/heads/main' }} |
|
21 | 25 |
|
22 | 26 | # Build the solution, run all tests, push packages to the PR feed |
23 | 27 | build-and-test: |
24 | | - if: >- |
25 | | - github.event_name == 'push' || |
26 | | - github.event.pull_request.user.login != github.repository_owner |
27 | 28 | strategy: |
28 | 29 | matrix: |
29 | 30 | configuration: [Debug, Release] |
|
0 commit comments