Skip to content

Commit 5798a5a

Browse files
chore: add GitHub Actions for building Android and iOS examples, and linting
1 parent 11a8c6e commit 5798a5a

File tree

6 files changed

+133
-40
lines changed

6 files changed

+133
-40
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: 'Setup Project'
2+
description: 'Checkout code, setup Node.js, enable Yarn, and install dependencies'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Checkout
8+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
9+
10+
- name: Setup Node
11+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
12+
with:
13+
node-version-file: '.nvmrc'
14+
cache: yarn
15+
16+
- name: Enable corepack
17+
shell: bash
18+
run: corepack enable
19+
20+
- name: Install dependencies
21+
shell: bash
22+
run: yarn install --immutable
23+
24+
- name: Prepare package
25+
shell: bash
26+
run: yarn prepare
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build Android Example
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build-android-example:
8+
name: Build Android Example
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Setup Project
13+
uses: ./.github/actions/setup-node-yarn
14+
15+
- name: Setup Java
16+
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e
17+
with:
18+
distribution: 'zulu'
19+
java-version: '17'
20+
21+
- name: Setup Android SDK
22+
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407
23+
24+
- name: Install NDK
25+
run: echo "y" | ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;27.1.12297006"
26+
27+
- name: Build with Gradle
28+
run: ./gradlew assembleDebug
29+
working-directory: example/android

.github/workflows/build-ios.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build iOS Example
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build-ios-example:
8+
name: Build iOS Example
9+
runs-on: macos-latest
10+
11+
steps:
12+
- name: Setup Project
13+
uses: ./.github/actions/setup-node-yarn
14+
15+
- name: Setup Xcode
16+
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
17+
with:
18+
xcode-version: latest-stable
19+
20+
- name: Setup Ruby
21+
uses: ruby/setup-ruby@d697be2f83c6234b20877c3b5eac7a7f342f0d0c
22+
with:
23+
ruby-version: '3.2'
24+
bundler-cache: true
25+
working-directory: example/ios
26+
27+
- name: Install CocoaPods
28+
working-directory: example/ios
29+
run: |
30+
bundle install
31+
bundle exec pod install
32+
33+
- name: Build iOS example for simulator
34+
working-directory: example/ios
35+
run: |
36+
xcodebuild \
37+
-workspace MendixNativeExample.xcworkspace \
38+
-scheme MendixNativeExample \
39+
-configuration Debug \
40+
-sdk iphonesimulator \
41+
-destination 'platform=iOS Simulator,name=iPhone 17,OS=latest' \
42+
-derivedDataPath build \
43+
CODE_SIGNING_ALLOWED=NO \
44+
CODE_SIGNING_REQUIRED=NO \
45+
build

.github/workflows/ci.yml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,15 @@ on:
55

66
jobs:
77
lint-and-build:
8-
name: Lint, Type Check & Build
9-
runs-on: ubuntu-latest
10-
11-
steps:
12-
- name: Checkout
13-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
14-
15-
- name: Setup Node
16-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
17-
with:
18-
node-version-file: '.nvmrc'
19-
cache: yarn
20-
21-
- name: Enable corepack
22-
run: corepack enable
23-
24-
- name: Install dependencies
25-
run: yarn install --immutable
26-
27-
- name: Type check
28-
run: yarn typecheck
29-
30-
- name: Lint check
31-
run: yarn lint
32-
33-
- name: Build
34-
run: yarn prepare
8+
name: Lint and Build
9+
uses: ./.github/workflows/lint-and-build.yml
10+
11+
build-android:
12+
name: Build Android
13+
needs: lint-and-build
14+
uses: ./.github/workflows/build-android.yml
15+
16+
build-ios:
17+
name: Build iOS
18+
needs: lint-and-build
19+
uses: ./.github/workflows/build-ios.yml
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Lint and Build
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
lint-and-build:
8+
name: Lint, Type Check & Build
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Setup Project
13+
uses: ./.github/actions/setup-node-yarn
14+
15+
- name: Type check
16+
run: yarn typecheck
17+
18+
- name: Lint check
19+
run: yarn lint

.github/workflows/release.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,8 @@ jobs:
2121
pull-requests: write
2222

2323
steps:
24-
- name: Checkout
25-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
26-
with:
27-
fetch-depth: 0
28-
29-
- name: Setup Node
30-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
31-
with:
32-
node-version-file: '.nvmrc'
33-
cache: yarn
34-
35-
- name: Enable corepack
36-
run: corepack enable
24+
- name: Setup Project
25+
uses: ./.github/actions/setup-node-yarn
3726

3827
- name: Extract release notes from Unreleased section
3928
id: changelog

0 commit comments

Comments
 (0)