docs: TESTING.md + SECURITY.md, and security/quality findings triage #33
Workflow file for this run
This file contains hidden or 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
| name: Main tests | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| setup: | |
| name: Setup code and environment needed for building, linting and tests | |
| runs-on: macos-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Cache Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: "gradle" | |
| # Workaround for https://github.com/actions/setup-java/issues/65 | |
| - name: Backup JAVA_HOME | |
| id: java-home | |
| run: echo "path=$JAVA_HOME" >> $GITHUB_OUTPUT | |
| - name: Validate Gradle wrapper | |
| uses: gradle/wrapper-validation-action@v3 | |
| - name: Cache module node modules | |
| uses: actions/cache@v4 | |
| id: cache-node-modules | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('package-lock.json') }} | |
| - name: Cache Example application node modules | |
| uses: actions/cache@v4 | |
| id: cache-app-node-modules | |
| with: | |
| path: ./Example/node_modules | |
| key: npm-${{ hashFiles('Example/package-lock.json') }} | |
| - name: Cache application pods | |
| uses: actions/cache@v4 | |
| id: cache-app-pods | |
| with: | |
| path: ./Example/ios/Pods | |
| key: pods-${{ hashFiles('Example/ios/Podfile.lock') }} | |
| - name: Install node modules | |
| run: npm ci | |
| - name: Install application node modules | |
| run: cd ./Example && npm ci | |
| - name: Install application pods if cache not present | |
| run: cd ./Example/ios && pod install | |
| if: steps.cache-app-pods.outputs.cache-hit != 'true' | |
| lint: | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Restore node modules from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('package-lock.json') }} | |
| - name: Install dependencies if cache miss | |
| run: npm ci | |
| - name: Lint | |
| run: npm run lint | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: setup | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Restore node modules from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('package-lock.json') }} | |
| - name: Install dependencies if cache miss | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| build-android: | |
| runs-on: ubuntu-latest | |
| needs: [setup] | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: "gradle" | |
| - name: Restore node modules from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('package-lock.json') }} | |
| - name: Restore application node modules from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./Example/node_modules | |
| key: npm-${{ hashFiles('Example/package-lock.json') }} | |
| - name: Install dependencies if cache miss | |
| run: npm ci | |
| - name: Install application dependencies if cache miss | |
| run: cd ./Example && npm ci | |
| - name: Build example application | |
| run: | | |
| cd ./Example/android | |
| ./gradlew assembleDebug | |
| build-ios: | |
| runs-on: macos-latest | |
| needs: [setup] | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node environment | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Restore node modules from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: npm-${{ hashFiles('package-lock.json') }} | |
| - name: Restore application node modules from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./Example/node_modules | |
| key: npm-${{ hashFiles('Example/package-lock.json') }} | |
| - name: Restore application pods from cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./Example/ios/Pods | |
| key: pods-${{ hashFiles('Example/ios/Podfile.lock') }} | |
| - name: Install dependencies if cache miss | |
| run: npm ci | |
| - name: Install application dependencies if cache miss | |
| run: cd ./Example && npm ci | |
| - name: Install application pods if cache miss | |
| run: cd ./Example/ios && pod install | |
| - name: Xcode Version | |
| run: /usr/bin/xcodebuild -version | |
| - name: Build Debug version | |
| run: | | |
| cd ./Example/ios | |
| xcodebuild -workspace HelloWorld.xcworkspace -scheme HelloWorld -configuration Debug -sdk iphonesimulator |