Skip to content

test(ci): use concurrency features to kill old runs #427

test(ci): use concurrency features to kill old runs

test(ci): use concurrency features to kill old runs #427

Workflow file for this run

name: CI
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
js-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install yarn
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: npm install -g yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-v1-
- name: Install dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: yarn install
- name: Run tests
run: yarn test
android-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install yarn
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: npm install -g yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-v1-
- name: Install dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: yarn install --frozen-lockfile
- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Build android example app
run: yarn example:install && yarn example:devcopy && yarn example:install && cd RNFBSDKExample && cd android && ./gradlew assembleDebug
ios-build:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3
- name: Install cocoapods
run: gem install cocoapods
- name: Install xcbeautify
run: brew install xcbeautify
- name: Install yarn
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: npm install -g yarn
- uses: hendrikmuhs/ccache-action@v1
name: Xcode Compile Cache
with:
key: ${{ runner.os }}-v1 # makes a unique key w/related restore key internally
max-size: 750M
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-v1
- uses: actions/cache@v4
name: Cache Pods
id: pods-cache
with:
path: RNFBSDKExample/ios/Pods
key: ${{ runner.os }}-pods-v1-${{ hashFiles('RNFBSDKExample/ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-pods-v1
- name: Install dependencies
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
retry_wait_seconds: 30
max_attempts: 3
command: yarn && yarn example:install
- name: Build ios example app
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
export CCACHE_FILECLONE=true
export CCACHE_DEPEND=true
export CCACHE_INODECACHE=true
export SKIP_BUNDLING=1
export RCT_NO_LAUNCH_PACKAGER=1
set -o pipefail
yarn example:devcopy && yarn example:install && cd RNFBSDKExample/ios
xcodebuild -scheme RNFBSDKExample -workspace RNFBSDKExample.xcworkspace VALID_ARCHS=\"`uname -m`\" ONLY_ACTIVE_ARCH=YES -sdk iphonesimulator -configuration Debug | xcbeautify