change default shell for config user to /bin/bash (#88) #202
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: DCS_Build | |
| on: | |
| pull_request: | |
| branches: [main, dev] | |
| push: | |
| branches: [ "main", "dev" ] | |
| permissions: | |
| packages: read | |
| jobs: | |
| # Build using ubuntu image | |
| dcs_build_ubuntu: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/nasa-ammos/dcs/build-image/dcs-builder-ubuntu-20.04:2025.08.19 | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: DCS | |
| submodules: recursive | |
| - name: build DCS | |
| run: | | |
| cd ./DCS | |
| export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 | |
| ./kmc-resources/scripts/build.sh | |
| - name: Verify build output | |
| run: ls -R ./DCS/build-output-for-sonar/ | |
| - name: Upload compiled classes | |
| uses: actions/upload-artifact@v4.6.2 | |
| with: | |
| name: compiled-classes | |
| path: DCS/build-output-for-sonar/ | |
| # Build using rocky image | |
| dcs_build_rocky: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/nasa-ammos/dcs/build-image/dcs-builder-rocky-9:2025.08.19 | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: DCS | |
| submodules: recursive | |
| - name: build DCS | |
| run: | | |
| cd ./DCS | |
| export JAVA_HOME=/usr/lib/jvm/java-17-openjdk | |
| ./kmc-resources/scripts/build.sh | |
| analyze: | |
| name: Analyze (${{ matrix.language }}) | |
| needs: dcs_build_ubuntu | |
| # 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 | |
| # Consider using larger runners for possible analysis time improvements. | |
| runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} | |
| timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} | |
| permissions: | |
| # required for all workflows | |
| security-events: write | |
| # only required for workflows in private repositories | |
| actions: read | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - language: c-cpp, java-kotlin | |
| 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 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Initializes the CodeQL tools for scanning. | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v3 | |
| with: | |
| languages: ${{ matrix.language }} | |
| build-mode: ${{ matrix.build-mode }} | |
| queries: security-and-quality, security-extended | |
| # 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. | |
| # 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 'If you are using a "manual" build mode for one or more of the' \ | |
| 'languages you are analyzing, replace this with the commands to build' \ | |
| 'your code, for example:' | |
| echo ' make bootstrap' | |
| echo ' make release' | |
| exit 1 | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v3 | |
| with: | |
| category: "/language:${{matrix.language}}" | |
| # This step is required to remove malformed data from the CodeQL output | |
| # It may be possible to remove in future iterations | |
| - name: Post-Process Output | |
| run: | | |
| python3 -m pip install nasa-scrub | |
| results_dir=`realpath ${{ github.workspace }}/../results` | |
| sarif_files=`find $results_dir -name '*.sarif'` | |
| for sarif_file in $sarif_files | |
| do | |
| output_file="$results_dir/$(basename $sarif_file .sarif)_stripped.sarif" | |
| python3 -m scrub.tools.parsers.translate_results $sarif_file $output_file ${{ github.workspace }} sarifv2.1.0 | |
| done | |
| echo "RESULTS_DIR=$results_dir" >> $GITHUB_ENV | |
| echo "Results generated: " | |
| echo $results_dir | |
| # This step makes the analysis artifacts available for download | |
| # This can be helpful for debugging and archive purposes | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4.6.2 | |
| with: | |
| name: codeql-artifacts | |
| path: ${{ env.RESULTS_DIR }} | |
| # Download DCS compiled class files for Sonar scan | |
| - name: Download compiled classes | |
| uses: actions/download-artifact@v5.0.0 | |
| with: | |
| name: compiled-classes | |
| path: build-output-for-sonar/ | |
| - name: Verify downloaded classes | |
| run: ls -R build-output-for-sonar/ | |
| # Download SARIF files for Sonar scan | |
| - name: Download SARIF Files | |
| uses: actions/download-artifact@v5.0.0 | |
| with: | |
| name: codeql-artifacts | |
| path: codeql-artifacts-for-sonar/ | |
| - name: Verify downloaded SARIF files | |
| run: pwd; ls -R codeql-artifacts-for-sonar/ | |
| - name: SonarCloud Scan | |
| uses: SonarSource/sonarqube-scan-action@v6.0.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| with: | |
| projectBaseDir: . | |
| args: > | |
| -Dsonar.organization=nasa-ammos | |
| -Dsonar.projectKey=NASA-AMMOS_KMC |