test-NIT.sh: add support for OpenSSH keys and certs (no NSS) [#13] #61
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
| # For most projects, this workflow file will not need changing; you simply need | |
| # to commit it to your repository. | |
| # | |
| # You may wish to alter this file to override the set of languages analyzed, | |
| # or to provide custom queries or build logic. | |
| # | |
| # ******** NOTE ******** | |
| # We have attempted to detect the languages in your repository. Please check | |
| # the `language` matrix defined below to confirm you have the correct set of | |
| # supported CodeQL languages. | |
| # | |
| name: "GHA-06: CodeQL Java" | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| # The branches below must be a subset of the branches above | |
| branches: [ "master" ] | |
| schedule: | |
| - cron: '32 12 * * 0' | |
| workflow_dispatch: | |
| # Allow manually running the action, e.g. if disabled after some quietness in the source | |
| jobs: | |
| analyze: | |
| name: Analyze | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs | |
| language: [ 'java' ] | |
| # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | |
| # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | |
| compilerpkg: [ 'openjdk-21-jdk' ] | |
| # TOTHINK: various JDK versions? | |
| os: [ 'ubuntu-latest' ] | |
| # TOTHINK: windows-latest, macos-latest? | |
| build-mode: [ 'autobuild' ] | |
| # manual ? | |
| # https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages | |
| # Abusing "manual" here to try building with ccache (and | |
| # have codeql not intercept that build but parse C/C++ | |
| # files on its own), and "manual" to custom-build without; | |
| # the "autobuild" mode is handled by codeql itself but | |
| # would probably ignore our CC/CXX setting | |
| # NOTE: We do not add ccache to PATH when actually compiling NUT code | |
| # (we only speed up "configure" stages), so compilation always happens | |
| # and is parsed by current CodeQL detectors of the day as they evolve! | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| # Using hints from https://askubuntu.com/questions/272248/processing-triggers-for-man-db | |
| - if: matrix.language == 'java' && matrix.os == 'ubuntu-latest' | |
| name: NUT CI Prerequisite packages (Ubuntu) | |
| run: | | |
| echo "set man-db/auto-update false" | sudo debconf-communicate | |
| sudo dpkg-reconfigure man-db | |
| sudo apt update | |
| sudo apt install ${{ matrix.compilerpkg }} maven | |
| date > .timestamp-init | |
| - name: Prepare maven cache | |
| # Based on https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#example-using-the-cache-action example | |
| id: cache-m2cache | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-m2cache- | |
| with: | |
| path: | | |
| ~/.m2 | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/.timestamp-init') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| # 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 (whole) list here with "+" to use these queries and those in the config file. | |
| # 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 | |
| config-file: ./.github/codeql/codeql-config.yml | |
| # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). | |
| # If this step fails, then you should remove it and run the build manually (see below) | |
| # https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages | |
| - if: matrix.build-mode == 'autobuild' | |
| name: Autobuild | |
| uses: github/codeql-action/autobuild@v3 | |
| # ℹ️ 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 != 'autobuild' && matrix.language == 'java' | |
| name: Maven build and test | |
| run: mvn package | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v3 | |
| with: | |
| category: "/language:${{matrix.language}}" |