Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add or edit github actions #8

Merged
merged 12 commits into from
Sep 26, 2024
27 changes: 4 additions & 23 deletions .github/workflows/cache.yml
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/workflows/cache.yml@main
15 changes: 2 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: lint
on:
push:
branches: [ 'main' ]
Expand All @@ -8,7 +8,7 @@ permissions:
id-token: write
attestations: write
jobs:
All:
lint_all:
runs-on: macos-latest
permissions:
id-token: write
Expand All @@ -29,15 +29,4 @@ jobs:
node_modules
key: node-modules
- run: npm i
- run: cd test-app && npm i
- run: npm run lint
- run: npm pack
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: package
path: '${{ github.workspace }}/*.tgz'
- name: Attest
uses: actions/attest-build-provenance@v1
with:
subject-path: '${{ github.workspace }}/*.tgz'
29 changes: 29 additions & 0 deletions .github/workflows/npm.yml
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
21 changes: 0 additions & 21 deletions .github/workflows/semantic-pr.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/semantic.yml
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/workflows/semantic.yml@main
axi92 marked this conversation as resolved.
Show resolved Hide resolved
118 changes: 118 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: test
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
jobs:
test_ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- uses: SwiftyLab/setup-swift@latest
with:
swift-version: '5.10.0'
- name: Get Swift Version
run: swift --version
- name: Get Xcode version
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app
run: xcodebuild -version
- name: Cache Pods
id: pods
uses: actions/cache@v4
with:
path: example/ios/Pods
key: pods-cache--${{ hashFiles('example/ios/podfile.lock') }}
- name: Cache Xcode DerivedData
uses: irgaly/[email protected]
with:
key: xcode-deriveddata
- 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: Pod Install
run: cd ios; pod install; cd -
- name: NPM Install
run: npm i
- name: Test iOS
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: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Install Android SDK
uses: android-actions/setup-android@v3
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
android/.gradle
test-app/android/.gradle
~/.gradle/caches
key: gradle
- name: Cache Android SDK
id: aandroid-sdk
uses: actions/cache@v4
with:
path: ~/Android/Sdk
key: android-sdk
- name: Enable KVM
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 AVD
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-29
- 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
run: npm i
- name: Test Android
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
working-directory: android/
script: ./gradlew clean build test connectedAndroidTest
Loading