Skip to content

chore: bulletproofing crypto box to cc migration (WPB-14250) (🍒4.6) #14063

chore: bulletproofing crypto box to cc migration (WPB-14250) (🍒4.6)

chore: bulletproofing crypto box to cc migration (WPB-14250) (🍒4.6) #14063

name: "iOS Tests"
on:
merge_group:
pull_request:
types: [ opened, synchronize ] # Don't rerun on `edited` to save time
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
detekt:
uses: ./.github/workflows/codestyle.yml
gradle-run-tests:
needs: [detekt]
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
# cache: gradle # Cache disabled as we use Gradle Setup below
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Gradle Setup
uses: gradle/gradle-build-action@v2
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build the samples
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew :samples:compileKotlinIosX64
- name: iOS Tests
run: ./gradlew iOSOnlyAffectedTest
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive Test Reports
if: always()
uses: actions/upload-artifact@v3
with:
name: test-reports
path: ./**/build/reports/tests/**
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
path: |
./**/build/test-results/testDebugUnitTest/**/*.xml
./**/build/test-results/**/*.xml
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/[email protected]
if: always()
with:
files: |
**/build/test-results/testDebugUnitTest/**/*.xml
**/build/test-results/**/*.xml
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
upload-test-results-datadadog:
runs-on: ubuntu-latest
needs: gradle-run-tests
if: always()
steps:
- name: Download tests results
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: test-results
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install datadog-ci
run: npm install -g @datadog/datadog-ci
- name: "Upload results"
env:
DATADOG_API_KEY: ${{ secrets.DD_API_KEY }}
DD_ENV: ci
DATADOG_SITE: datadoghq.eu
run: |
find . -name "*.xml" -type f | sed 's/ /\\ /g' | tr '\n' ' ' | xargs -L 1 datadog-ci junit upload --service kalium-ios .