-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add or edit github actions (#8)
Co-authored-by: axi92 <[email protected]>
- Loading branch information
Showing
18 changed files
with
361 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: 'capacitor-setup-android' | ||
description: '' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Install JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Install Android SDK | ||
uses: android-actions/setup-android@v3 | ||
- name: Enable KVM | ||
shell: bash | ||
run: | | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
- name: Cache node_modules | ||
id: node-modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
node_modules | ||
key: node-modules | ||
- name: Cache Gradle | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
android/.gradle | ||
~/.gradle/caches | ||
key: gradle | ||
- name: Cache Android SDK | ||
id: android-sdk | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/Android/Sdk | ||
key: android-sdk | ||
- name: Cache AVD | ||
uses: actions/cache@v4 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-29 | ||
- name: Npm Install | ||
shell: bash | ||
run: npm i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: 'capacitor-setup-ios' | ||
description: '' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Install Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.3' | ||
bundler-cache: true | ||
- name: Install Swift | ||
uses: SwiftyLab/setup-swift@latest | ||
with: | ||
swift-version: '5.10.0' | ||
- name: Cache node_modules | ||
id: node-modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
node_modules | ||
key: node-modules | ||
- name: Cache Pods | ||
id: pods | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
ios/Pods | ||
key: pods | ||
- name: Cache Xcode | ||
uses: irgaly/[email protected] | ||
with: | ||
key: xcode-deriveddata | ||
restore-keys: xcode-deriveddata | ||
- name: Npm Install | ||
shell: bash | ||
run: npm i | ||
- name: Pod Install | ||
shell: bash | ||
run: cd ios; pod install; cd - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: 'capacitor-setup-web' | ||
description: '' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Cache node_modules | ||
id: node-modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
node_modules | ||
key: node-modules | ||
- name: Npm Install | ||
shell: bash | ||
run: npm i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: build | ||
on: | ||
push: | ||
branches: [ 'main' ] | ||
pull_request: | ||
branches: [ 'main' ] | ||
jobs: | ||
build_web: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Capacitor iOS | ||
uses: ./.github/actions/capacitor-setup-web | ||
- name: Run Build | ||
run: npm run verify:web | ||
build_ios: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Capacitor iOS | ||
uses: ./.github/actions/capacitor-setup-ios | ||
- name: Run Build | ||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_15.4.app | ||
run: | | ||
cd ios | ||
xcodebuild \ | ||
-quiet \ | ||
-workspace Plugin.xcworkspace \ | ||
-scheme Plugin \ | ||
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' | ||
build_android: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Capacitor Android | ||
uses: ./.github/actions/capacitor-setup-android | ||
- name: Run Build | ||
run: npm run verify:android |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,9 @@ | ||
name: Cache | ||
name: cache | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
jobs: | ||
clear: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Execute | ||
run: | | ||
gh extension install actions/gh-actions-cache | ||
echo "Fetching list of cache key" | ||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 ) | ||
## Setting this to not fail the workflow while deleting cache keys. | ||
set +e | ||
echo "Deleting caches..." | ||
for cacheKey in $cacheKeysForPR | ||
do | ||
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm | ||
done | ||
echo "Done" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPO: ${{ github.repository }} | ||
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge | ||
cache_cleanup: | ||
name: Clean up cache | ||
uses: evva-sfw/workflows/.github/workflows/cache.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: npm | ||
on: | ||
push: | ||
branches: [ 'main' ] | ||
pull_request: | ||
branches: [ 'main' ] | ||
jobs: | ||
npm_check-package-sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Cache node_modules | ||
id: node-modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
node_modules | ||
test-app/node_modules | ||
key: node-modules | ||
- name: NPM Install | ||
run: npm i | ||
- name: Check if git is clean | ||
uses: CatChen/check-git-status-action@v1 | ||
with: | ||
fail-if-not-clean: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: semantic | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
permissions: | ||
pull-requests: read | ||
jobs: | ||
semantic_pr-name: | ||
name: semantic_pr-name | ||
uses: evva-sfw/workflows/.github/workflows/semantic.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: test | ||
on: | ||
push: | ||
branches: [ 'main' ] | ||
pull_request: | ||
branches: [ 'main' ] | ||
jobs: | ||
test_ios: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Capacitor iOS | ||
uses: ./.github/actions/capacitor-setup-ios | ||
- name: Run Tests | ||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_15.4.app | ||
run: | | ||
cd ios | ||
xcodebuild \ | ||
-quiet \ | ||
-workspace Plugin.xcworkspace \ | ||
-scheme Plugin \ | ||
-sdk iphonesimulator \ | ||
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.4' \ | ||
test || exit 1 | ||
test_android: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Capacitor Android | ||
uses: ./.github/actions/capacitor-setup-android | ||
- name: Run Tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: 29 | ||
working-directory: android/ | ||
script: ./gradlew clean build test connectedAndroidTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ext { | ||
minSdkVersion = 29 | ||
compileSdkVersion = 34 | ||
targetSdkVersion = 34 | ||
|
||
androidxActivityVersion = '1.8.0' | ||
androidxAppCompatVersion = '1.6.1' | ||
androidxCoordinatorLayoutVersion = '1.2.0' | ||
androidxCoreVersion = '1.12.0' | ||
androidxFragmentVersion = '1.6.2' | ||
androidxJunitVersion = '1.2.1' | ||
androidxWebkitVersion = '1.9.0' | ||
|
||
coreSplashScreenVersion = '1.0.1' | ||
|
||
junitVersion = '4.13.2' | ||
androidxEspressoCoreVersion = '3.6.1' | ||
cordovaAndroidVersion = '10.1.1' | ||
} |
Oops, something went wrong.