diff --git a/.github/workflows/CodeQL.yml b/.github/workflows/CodeQL.yml index c9ddbf892ca1e..67a2eb9c7c895 100644 --- a/.github/workflows/CodeQL.yml +++ b/.github/workflows/CodeQL.yml @@ -1,18 +1,14 @@ name: "CodeQL" on: - workflow_call: + push: + workflow_dispatch: jobs: analyze: name: Analyze (${{ matrix.language }}) - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners (GitHub.com only) - # Consider using larger runners or machines with greater resources for possible analysis time improvements. runs-on: 'ubuntu-latest' - timeout-minutes: 360 + timeout-minutes: 60 permissions: # required for all workflows security-events: write @@ -25,55 +21,49 @@ jobs: fail-fast: false matrix: include: - - language: c-cpp - build-mode: manual - - language: python - build-mode: none - # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + - language: c-cpp + build-mode: manual + config: icicle:nsh + - language: c-cpp + build-mode: manual + config: imx93-evk:nsh + - language: python + build-mode: none steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Checkout apps + uses: actions/checkout@v4 + with: + repository: 'tiiuae/incubator-nuttx-apps.git' + path: 'apps' + ref: 'master' + - name: Install tools + run: | + mv apps ../apps + sudo apt-get install kconfig-frontends + mkdir -p ../bin + cd ../bin + wget https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz + wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-elf.tar.xz + tar xvf riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz + tar xvf arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-elf.tar.xz - - name: Download Source Artifact - uses: actions/download-artifact@v4 - with: - name: source-bundle - path: . + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. + - if: matrix.build-mode == 'manual' + run: | + export PATH=$PATH:$PWD/../bin/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14/bin/ + export PATH=$PATH:$PWD/../bin/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-elf/bin + ./tools/configure.sh ${{matrix.config}} + make - # 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 - # queries: security-extended,security-and-quality - - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - if: matrix.build-mode == 'manual' - run: | - echo "::add-matcher::nuttx/.github/gcc.json" - export ARTIFACTDIR=`pwd`/buildartifacts - cd nuttx/tools/ci - ./cibuild.sh -i -c -A -R testlist/ssrc-riscv.dat - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a5a75c8943d5..e674a6c7d88d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,17 +114,13 @@ jobs: uses: actions/download-artifact@v4 with: name: source-bundle - path: sources + path: . # cibuild.sh -i installs the tools for us - name: Run builds run: | - echo "::add-matcher::sources/nuttx/.github/gcc.json" + echo "::add-matcher::nuttx/.github/gcc.json" export ARTIFACTDIR=`pwd`/buildartifacts - cd sources/nuttx/tools/ci + cd nuttx/tools/ci ./cibuild.sh -i -c -A -R testlist/${{matrix.boards}}.dat - CodeQL: - needs: Fetch-Source - uses: "./.github/workflows/CodeQL.yml" -