From eb4f358c6b29293d75f456d09e391b3d20e95d11 Mon Sep 17 00:00:00 2001 From: Ning Shang Date: Tue, 26 Mar 2024 17:11:18 -0700 Subject: [PATCH] GHA: bump codeql-action version (#42) * GHA: bump codeql-action version And cleanup the workflow file. * Cleanup publish-docs.yml Some more cleanups. * GHA: use the ubuntu-22.04 runner for all workflows This is the current ubuntu-latest. * GHA: more cleanups Add some more cleanups. --- .github/workflows/clang-sa.yml | 18 ++++++----- .github/workflows/codeql-analysis.yml | 44 ++++++--------------------- .github/workflows/publish-docs.yml | 6 +--- .github/workflows/release.yml | 2 +- .github/workflows/sanity.yml | 2 +- 5 files changed, 23 insertions(+), 49 deletions(-) diff --git a/.github/workflows/clang-sa.yml b/.github/workflows/clang-sa.yml index c941bc2..b021f58 100644 --- a/.github/workflows/clang-sa.yml +++ b/.github/workflows/clang-sa.yml @@ -1,5 +1,5 @@ # Static analysis via clang static analyzer -name: "Clang Static Analysis" +name: 'Clang Static Analysis' on: push: @@ -10,16 +10,18 @@ on: jobs: sacheck: - name: "Clang Static Analysis" - runs-on: ubuntu-latest + name: 'Clang Static Analysis' + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-22.04] defaults: run: shell: bash -euxo pipefail {0} - strategy: - fail-fast: false steps: - - name: Checkout repository + - name: 'Checkout repository' uses: actions/checkout@v4.1.1 with: # We must fetch at least the immediate parents so that if this is @@ -27,7 +29,7 @@ jobs: fetch-depth: 2 submodules: 'recursive' - - name: Install dependencies + - name: 'Install dependencies' run: | sudo apt update sudo apt install -y texinfo texlive-latex-extra @@ -36,7 +38,7 @@ jobs: sudo ln -sf /usr/bin/clang-check-14 /usr/bin/clang-check # Run static analysis - - name: Run clang static analysis + - name: 'Run clang static analysis' run: | cd ${{ github.workspace }} autoreconf -vi diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9fd34ab..02e1173 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,15 +1,4 @@ -# 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: "CodeQL" +name: 'CodeQL' on: push: @@ -22,13 +11,13 @@ on: jobs: analyze: - name: Analyze + name: 'Analyze' runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-20.04] + os: [ubuntu-22.04] compiler_c: [gcc] compiler_cxx: [g++] language: [ 'cpp' ] @@ -37,36 +26,23 @@ jobs: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed steps: - - name: Checkout repository + - name: 'Checkout repository' uses: actions/checkout@v4.1.1 # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + - name: 'Initialize CodeQL' + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - # 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. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Install dependencies + - name: 'Install build dependencies' run: | sudo apt-get update sudo apt-get install -y texinfo sudo apt-get install -y autotools-dev autoconf build-essential bear - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - # Use custom build process for C/C++ - - name: Build + - name: 'Build' env: CC: ${{ matrix.compiler_c }} CXX: ${{ matrix.compiler_cxx }} @@ -75,5 +51,5 @@ jobs: autoreconf -vi ./scripts/build.sh - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: 'Perform CodeQL analysis' + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index d9aeb3f..9aad4c9 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -12,8 +12,6 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - #compiler_c: [clang] - #compiler_cxx: [clang++] steps: - name: Checkout uses: actions/checkout@v4.1.1 @@ -23,10 +21,8 @@ jobs: sudo apt install -y texinfo sudo apt install -y autotools-dev autoconf build-essential - name: Publish docs - #env: - # CC: ${{ matrix.compiler_c }} - # CXX: ${{ matrix.compiler_cxx }} run: | + set -euxo pipefail cd ${{ github.workspace }} autoreconf -vi ./scripts/publish-docs.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 241672f..484695b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-22.04] steps: - name: Checkout code uses: actions/checkout@v4.1.1 diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml index 32f8d64..8602ba9 100644 --- a/.github/workflows/sanity.yml +++ b/.github/workflows/sanity.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest] + os: [ubuntu-22.04] compiler_c: [gcc, clang] compiler_cxx: [g++, clang++] steps: