|
| 1 | +# For most projects, this workflow file will not need changing; you simply need |
| 2 | +# to commit it to your repository. |
| 3 | +# |
| 4 | +# You may wish to alter this file to override the set of languages analyzed, |
| 5 | +# or to provide custom queries or build logic. |
| 6 | +# |
| 7 | +# ******** NOTE ******** |
| 8 | +# We have attempted to detect the languages in your repository. Please check |
| 9 | +# the `language` matrix defined below to confirm you have the correct set of |
| 10 | +# supported CodeQL languages. |
| 11 | +# |
| 12 | +name: "CodeQL Advanced" |
| 13 | + |
| 14 | +on: |
| 15 | + push: |
| 16 | + branches: [ "master" ] |
| 17 | + pull_request: |
| 18 | + branches: [ "master" ] |
| 19 | + |
| 20 | +jobs: |
| 21 | + Analyze_Ruby_JSandTS: |
| 22 | + name: Analyze (${{ matrix.language }}) |
| 23 | + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} |
| 24 | + permissions: |
| 25 | + # required for all workflows |
| 26 | + security-events: write |
| 27 | + |
| 28 | + # required to fetch internal or private CodeQL packs |
| 29 | + packages: read |
| 30 | + |
| 31 | + # only required for workflows in private repositories |
| 32 | + actions: read |
| 33 | + contents: read |
| 34 | + |
| 35 | + strategy: |
| 36 | + fail-fast: false |
| 37 | + matrix: |
| 38 | + include: |
| 39 | + - language: actions |
| 40 | + build-mode: none |
| 41 | + - language: javascript-typescript |
| 42 | + build-mode: none |
| 43 | + - language: ruby |
| 44 | + build-mode: none |
| 45 | + steps: |
| 46 | + - name: Checkout repository |
| 47 | + uses: actions/checkout@v4 |
| 48 | + |
| 49 | + # Add any setup steps before running the `github/codeql-action/init` action. |
| 50 | + # This includes steps like installing compilers or runtimes (`actions/setup-node` |
| 51 | + # or others). This is typically only required for manual builds. |
| 52 | + # - name: Setup runtime (example) |
| 53 | + # uses: actions/setup-example@v1 |
| 54 | + |
| 55 | + # Initializes the CodeQL tools for scanning. |
| 56 | + - name: Initialize CodeQL |
| 57 | + uses: github/codeql-action/init@v3 |
| 58 | + with: |
| 59 | + languages: ${{ matrix.language }} |
| 60 | + build-mode: ${{ matrix.build-mode }} |
| 61 | + # If you wish to specify custom queries, you can do so here or in a config file. |
| 62 | + # By default, queries listed here will override any specified in a config file. |
| 63 | + # Prefix the list here with "+" to use these queries and those in the config file. |
| 64 | + |
| 65 | + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs |
| 66 | + queries: ${{ matrix.language && 'security-extended, security-and-quality' }} |
| 67 | + |
| 68 | + - if: matrix.build-mode == 'manual' |
| 69 | + shell: bash |
| 70 | + run: | |
| 71 | + echo 'If you are using a "manual" build mode for one or more of the' \ |
| 72 | + 'languages you are analyzing, replace this with the commands to build' \ |
| 73 | + 'your code, for example:' |
| 74 | + echo ' make bootstrap' |
| 75 | + echo ' make release' |
| 76 | + exit 1 |
| 77 | + - name: Perform CodeQL Analysis |
| 78 | + uses: github/codeql-action/analyze@v3 |
| 79 | + with: |
| 80 | + category: "/language:${{matrix.language}}" |
| 81 | + |
| 82 | + Build_Analyze_Android_Example: |
| 83 | + name: Analyze (${{ matrix.language }}) |
| 84 | + runs-on: ubuntu-latest |
| 85 | + env: |
| 86 | + TURBO_CACHE_DIR: .turbo/android |
| 87 | + permissions: |
| 88 | + # required for all workflows |
| 89 | + security-events: write |
| 90 | + |
| 91 | + # required to fetch internal or private CodeQL packs |
| 92 | + packages: read |
| 93 | + |
| 94 | + # only required for workflows in private repositories |
| 95 | + actions: read |
| 96 | + contents: read |
| 97 | + |
| 98 | + strategy: |
| 99 | + fail-fast: false |
| 100 | + matrix: |
| 101 | + include: |
| 102 | + - language: java-kotlin |
| 103 | + build-mode: manual |
| 104 | + |
| 105 | + steps: |
| 106 | + - name: Checkout repository |
| 107 | + uses: actions/checkout@v4 |
| 108 | + |
| 109 | + # Add any setup steps before running the `github/codeql-action/init` action. |
| 110 | + # This includes steps like installing compilers or runtimes (`actions/setup-node` |
| 111 | + # or others). This is typically only required for manual builds. |
| 112 | + # - name: Setup runtime (example) |
| 113 | + # uses: actions/setup-example@v1 |
| 114 | + |
| 115 | + - name: Setup |
| 116 | + uses: ./.github/actions/setup |
| 117 | + |
| 118 | + - name: Install JDK |
| 119 | + if: env.turbo_cache_hit != 1 |
| 120 | + uses: actions/setup-java@v3 |
| 121 | + with: |
| 122 | + distribution: 'zulu' |
| 123 | + java-version: '17' |
| 124 | + |
| 125 | + - name: Finalize Android SDK |
| 126 | + if: env.turbo_cache_hit !=1 |
| 127 | + run: | |
| 128 | + /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" |
| 129 | +
|
| 130 | + # Initializes the CodeQL tools for scanning. |
| 131 | + - name: Initialize CodeQL |
| 132 | + uses: github/codeql-action/init@v3 |
| 133 | + with: |
| 134 | + languages: ${{ matrix.language }} |
| 135 | + build-mode: ${{ matrix.build-mode }} |
| 136 | + # If you wish to specify custom queries, you can do so here or in a config file. |
| 137 | + # By default, queries listed here will override any specified in a config file. |
| 138 | + # Prefix the list here with "+" to use these queries and those in the config file. |
| 139 | + |
| 140 | + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs |
| 141 | + queries: ${{ matrix.language && 'security-extended, security-and-quality' }} |
| 142 | + |
| 143 | + - if: matrix.build-mode == 'manual' |
| 144 | + shell: bash |
| 145 | + run: | |
| 146 | + cd example |
| 147 | + yarn install |
| 148 | + cd android |
| 149 | + ./gradlew clean |
| 150 | +
|
| 151 | + - name: Perform CodeQL Analysis |
| 152 | + uses: github/codeql-action/analyze@v3 |
| 153 | + with: |
| 154 | + category: "/language:${{matrix.language}}" |
| 155 | + |
| 156 | + Build_Analyze_iOS_Example: |
| 157 | + name: Analyze (${{ matrix.language }}) |
| 158 | + timeout-minutes: 120 |
| 159 | + env: |
| 160 | + TURBO_CACHE_DIR: .turbo/ios |
| 161 | + TURBO_TOKEN: ${{ secrets. TURBO_TOKEN }} |
| 162 | + TURBO_TEAM: ${{ secrets. TURBO_TEAM }} |
| 163 | + |
| 164 | + runs-on: ${{ (matrix.language == 'swift' && 'macos-15') || 'ubuntu-latest' }} |
| 165 | + permissions: |
| 166 | + # required for all workflows |
| 167 | + security-events: write |
| 168 | + # required to fetch internal or private CodeQL packs |
| 169 | + packages: read |
| 170 | + # only required for workflows in private repositories |
| 171 | + actions: read |
| 172 | + contents: read |
| 173 | + |
| 174 | + strategy: |
| 175 | + fail-fast: false |
| 176 | + matrix: |
| 177 | + include: |
| 178 | + - language: swift |
| 179 | + build-mode: manual |
| 180 | + |
| 181 | + steps: |
| 182 | + - name: Checkout react-native-sdk |
| 183 | + uses: actions/checkout@v4 |
| 184 | + |
| 185 | + - name: Setup |
| 186 | + uses: ./.github/actions/setup |
| 187 | + |
| 188 | + # Initializes the CodeQL tools for scanning. |
| 189 | + - name: Initialize CodeQL |
| 190 | + uses: github/codeql-action/init@v3 |
| 191 | + with: |
| 192 | + languages: ${{ matrix.language }} |
| 193 | + build-mode: ${{ matrix.build-mode }} |
| 194 | + # If you wish to specify custom queries, you can do so here or in a config file. |
| 195 | + # By default, queries listed here will override any specified in a config file. |
| 196 | + # Prefix the list here with "+" to use these queries and those in the config file. |
| 197 | + |
| 198 | + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs |
| 199 | + queries: ${{ matrix.language && 'security-extended, security-and-quality' }} |
| 200 | + |
| 201 | + - if: matrix.build-mode == 'manual' |
| 202 | + shell: bash |
| 203 | + run: | |
| 204 | + cd example |
| 205 | + yarn install |
| 206 | + cd ios |
| 207 | + bundle install |
| 208 | + bundle exec pod install |
| 209 | + xcodebuild -workspace ReactNativeSdkExample.xcworkspace -scheme ReactNativeSdkExample -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 16' build |
| 210 | +
|
| 211 | + - name: Perform CodeQL Analysis |
| 212 | + uses: github/codeql-action/analyze@v3 |
| 213 | + with: |
| 214 | + category: "/language:${{matrix.language}}" |
0 commit comments