|
| 1 | +name: "CodeQL Analysis" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + Analyze_JSandTS: |
| 11 | + name: Analyze (${{ matrix.language }}) |
| 12 | + runs-on: ${{ (matrix.language == 'javascript') || 'ubuntu-latest' }} |
| 13 | + permissions: |
| 14 | + # required for all workflows |
| 15 | + security-events: write |
| 16 | + |
| 17 | + # required to fetch internal or private CodeQL packs |
| 18 | + packages: read |
| 19 | + |
| 20 | + # only required for workflows in private repositories |
| 21 | + actions: read |
| 22 | + contents: read |
| 23 | + |
| 24 | + strategy: |
| 25 | + fail-fast: false |
| 26 | + matrix: |
| 27 | + include: |
| 28 | + - language: actions |
| 29 | + build-mode: none |
| 30 | + - language: javascript-typescript |
| 31 | + build-mode: none |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Checkout repository |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + # Initializes the CodeQL tools for scanning. |
| 38 | + - name: Initialize CodeQL |
| 39 | + uses: github/codeql-action/init@v3 |
| 40 | + with: |
| 41 | + languages: ${{ matrix.language }} |
| 42 | + build-mode: ${{ matrix.build-mode }} |
| 43 | + |
| 44 | + # 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 |
| 45 | + queries: ${{ matrix.language && 'security-extended, security-and-quality' }} |
| 46 | + |
| 47 | + |
| 48 | + # If the analyze step fails for one of the languages you are analyzing with |
| 49 | + # "We were unable to automatically build your code", modify the matrix above |
| 50 | + # to set the build mode to "manual" for that language. Then modify this step |
| 51 | + # to build your code. |
| 52 | + # ℹ️ Command-line programs to run using the OS shell. |
| 53 | + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
| 54 | + - if: matrix.build-mode == 'manual' |
| 55 | + shell: bash |
| 56 | + run: | |
| 57 | + echo 'If you are using a "manual" build mode for one or more of the' \ |
| 58 | + 'languages you are analyzing, replace this with the commands to build' \ |
| 59 | + 'your code, for example:' |
| 60 | + echo ' make bootstrap' |
| 61 | + echo ' make release' |
| 62 | + exit 1 |
| 63 | +
|
| 64 | + - name: Perform CodeQL Analysis |
| 65 | + uses: github/codeql-action/analyze@v3 |
| 66 | + with: |
| 67 | + category: "/language:${{matrix.language}}" |
| 68 | + |
| 69 | + |
| 70 | + Build_Analyze_Android_Example: |
| 71 | + name: Analyze (${{ matrix.language }}) |
| 72 | + runs-on: ubuntu-latest |
| 73 | + permissions: |
| 74 | + # required for all workflows |
| 75 | + security-events: write |
| 76 | + |
| 77 | + # required to fetch internal or private CodeQL packs |
| 78 | + packages: read |
| 79 | + |
| 80 | + # only required for workflows in private repositories |
| 81 | + actions: read |
| 82 | + contents: read |
| 83 | + |
| 84 | + strategy: |
| 85 | + fail-fast: false |
| 86 | + matrix: |
| 87 | + include: |
| 88 | + - language: java |
| 89 | + build-mode: manual |
| 90 | + |
| 91 | + steps: |
| 92 | + |
| 93 | + - name: Checkout |
| 94 | + uses: actions/checkout@v4 |
| 95 | + |
| 96 | + - name: Setup |
| 97 | + uses: ./.github/actions/setup |
| 98 | + |
| 99 | + - name: Build library |
| 100 | + run: | |
| 101 | + yarn prepare |
| 102 | +
|
| 103 | + # Add any setup steps before running the `github/codeql-action/init` action. |
| 104 | + # This includes steps like installing compilers or runtimes (`actions/setup-node` |
| 105 | + # or others). This is typically only required for manual builds. |
| 106 | + # - name: Setup runtime (example) |
| 107 | + # uses: actions/setup-example@v1 |
| 108 | + |
| 109 | + # Initializes the CodeQL tools for scanning. |
| 110 | + - name: Initialize CodeQL |
| 111 | + uses: github/codeql-action/init@v3 |
| 112 | + with: |
| 113 | + languages: ${{ matrix.language }} |
| 114 | + build-mode: ${{ matrix.build-mode }} |
| 115 | + # If you wish to specify custom queries, you can do so here or in a config file. |
| 116 | + # By default, queries listed here will override any specified in a config file. |
| 117 | + # Prefix the list here with "+" to use these queries and those in the config file. |
| 118 | + |
| 119 | + # 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 |
| 120 | + queries: ${{ matrix.language && 'security-extended, security-and-quality' }} |
| 121 | + |
| 122 | + - if: matrix.build-mode == 'manual' |
| 123 | + shell: bash |
| 124 | + run: | |
| 125 | + yarn install |
| 126 | + cd example |
| 127 | + yarn install |
| 128 | + npx expo prebuild --clean |
| 129 | + cd android |
| 130 | + ./gradlew clean |
| 131 | +
|
| 132 | + continue-on-error: true |
| 133 | + |
| 134 | + - name: Perform CodeQL Analysis |
| 135 | + uses: github/codeql-action/analyze@v3 |
| 136 | + with: |
| 137 | + category: "/language:${{matrix.language}}" |
| 138 | + |
| 139 | + Build_Analyze_iOS_Example: |
| 140 | + name: Analyze (${{ matrix.language }}) |
| 141 | + timeout-minutes: 120 |
| 142 | + |
| 143 | + runs-on: ${{ (matrix.language == 'swift' && 'macos-15') || 'ubuntu-latest' }} |
| 144 | + permissions: |
| 145 | + # required for all workflows |
| 146 | + security-events: write |
| 147 | + # required to fetch internal or private CodeQL packs |
| 148 | + packages: read |
| 149 | + # only required for workflows in private repositories |
| 150 | + actions: read |
| 151 | + contents: read |
| 152 | + |
| 153 | + strategy: |
| 154 | + fail-fast: false |
| 155 | + matrix: |
| 156 | + include: |
| 157 | + - language: swift |
| 158 | + build-mode: manual |
| 159 | + |
| 160 | + steps: |
| 161 | + |
| 162 | + - name: Checkout |
| 163 | + uses: actions/checkout@v4 |
| 164 | + |
| 165 | + - name: Setup |
| 166 | + uses: ./.github/actions/setup |
| 167 | + |
| 168 | + - name: Build library |
| 169 | + run: | |
| 170 | + yarn prepare |
| 171 | +
|
| 172 | +# Initializes the CodeQL tools for scanning. |
| 173 | + - name: Initialize CodeQL |
| 174 | + uses: github/codeql-action/init@v3 |
| 175 | + with: |
| 176 | + languages: ${{ matrix.language }} |
| 177 | + build-mode: ${{ matrix.build-mode }} |
| 178 | + # If you wish to specify custom queries, you can do so here or in a config file. |
| 179 | + # By default, queries listed here will override any specified in a config file. |
| 180 | + # Prefix the list here with "+" to use these queries and those in the config file. |
| 181 | + |
| 182 | + # 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 |
| 183 | + queries: ${{ matrix.language && 'security-extended, security-and-quality' }} |
| 184 | + |
| 185 | + - if: matrix.build-mode == 'manual' |
| 186 | + shell: bash |
| 187 | + run: | |
| 188 | + yarn install |
| 189 | + cd example |
| 190 | + yarn install |
| 191 | + npx expo prebuild --clean |
| 192 | + cd ios |
| 193 | + xcodebuild -workspace expopluginexample.xcworkspace -scheme expopluginexample -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 16' build |
| 194 | +
|
| 195 | + continue-on-error: true |
| 196 | + |
| 197 | + - name: Perform CodeQL Analysis |
| 198 | + uses: github/codeql-action/analyze@v3 |
| 199 | + with: |
| 200 | + category: "/language:${{matrix.language}}" |
0 commit comments