Skip to content

Commit 8197401

Browse files
compose workflows
1 parent b8291c7 commit 8197401

File tree

6 files changed

+67
-20
lines changed

6 files changed

+67
-20
lines changed

.github/workflows/build-module.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
name: Export module package
22
on:
3-
push:
4-
paths:
5-
- "module/**"
6-
pull_request:
7-
paths:
8-
- "module/**"
3+
workflow_call:
94
workflow_dispatch:
105
jobs:
116
build:

.github/workflows/build-widget.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
name: Build widget
22
on:
3-
push:
4-
paths:
5-
- "widget/**"
6-
pull_request:
7-
paths:
8-
- "widget/**"
3+
workflow_call:
94
workflow_dispatch:
105
defaults:
116
run:
127
working-directory: ./widget
138
jobs:
14-
build-widget:
9+
build:
1510
runs-on: ubuntu-latest
1611
steps:
1712
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/pull-request.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Build widget
2+
on:
3+
pull_request:
4+
jobs:
5+
build-module:
6+
uses: ./.github/workflows/build-module.yml
7+
secrets: inherit
8+
build-widget:
9+
uses: ./.github/workflows/build-widget.yml
10+
secrets: inherit
11+
snyk:
12+
uses: ./.github/workflows/snyk.yml
13+
secrets: inherit

.github/workflows/push-master.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Run Snyk scan
2+
3+
on:
4+
push:
5+
branches: [ "master", "mx8" ]
6+
7+
jobs:
8+
snyk:
9+
uses: ./.github/workflows/snyk.yml
10+
with:
11+
command: "monitor"
12+
suffix: -${{ github.ref_name }}
13+
secrets: inherit

.github/workflows/snyk.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,47 @@
11
name: Run Snyk scan
22

33
on:
4-
push:
5-
branches: [ "master" ]
4+
workflow_call:
5+
inputs:
6+
command:
7+
type: string
8+
required: false
9+
default: 'test'
10+
suffix:
11+
type: string
12+
required: false
613
workflow_dispatch:
714

815
jobs:
9-
snyk-test:
10-
runs-on: ubuntu-latest
16+
snyk-test-gradle:
17+
runs-on: windows-latest
1118
steps:
1219
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
with:
23+
repository: 'mendixlabs/mendix-gradle-plugin'
24+
path: 'mendix-gradle-plugin'
25+
ref: '114bde309b52b037583d95a9beffee18eb71b65f'
26+
ssh-key: ${{ secrets.MENDIX_GRADLE_PLUGIN_SSH }}
27+
ssh-strict: false
28+
29+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 #4.7.1
30+
with:
31+
distribution: 'adopt'
32+
java-version: '21'
33+
- uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 #4.3.1
34+
35+
- name: Build mendix-gradle-plugin
36+
working-directory: mendix-gradle-plugin
37+
run: |
38+
echo "kotlin.jvm.target.validation.mode = IGNORE" >> gradle.properties
39+
./gradlew build publishToMavenLocal
40+
1341
- name: Run Snyk to check for vulnerabilities
1442
uses: snyk/actions/gradle@b98d498629f1c368650224d6d212bf7dfa89e4bf # 0.4.0
1543
env:
1644
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
1745
with:
18-
command: monitor
19-
args: --project-name="MxPushNotifications" --file=build.gradle
46+
command: ${{ inputs.command }}
47+
args: --project-name="gradle${{ inputs.suffix }}" --file=module/build.gradle

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,7 @@ The userlibs for the PushNotifications module are not part of the repo.
5858
To fetch them, run the `updateUserLibs` task after checking out the repo (and after switching branches).
5959

6060
Changes to the `userlib` folder are ignored by git.
61-
If you make any changes to the libraries required by other modules, you must commit these explicitly, using e.g. `git add -f <path>`.
61+
If you make any changes to the libraries required by other modules, you must commit these explicitly, using e.g. `git add -f <path>`.
62+
63+
Although the widget is built as part of the CI workflows, it is not integrated into the module.
64+
Newly built widget versions must always be committed manually.

0 commit comments

Comments
 (0)