From 22695adf387b9511120c61f626a8ba72398996fb Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Fri, 7 Jun 2024 20:13:23 -0400 Subject: [PATCH 01/15] ci: Build nightly distribution tarballs. --- .github/workflows/nightly.yml | 87 +++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..ee3c64685 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,87 @@ +name: Nightly + +on: + schedule: + - cron: '14 20 * * *' + +permissions: {} + +jobs: + nightly: + name: Run a Nightly Build and Save the Artifacts + runs-on: ubuntu-20.04 + outputs: + tagname: ${{ steps.version.outputs.tagname }} + version: ${{ steps.version.outputs.version }} + permissions: + actions: read + contents: read + steps: + - name: apt + run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive + - uses: actions/checkout@v4 + - name: Change version number + id: version + run: | + slug=$(git log -n 1 --pretty='format:%h-%as') + echo "::set-output name=tagname::$slug" + ver=$(sed -n "s/^\(AC_INIT.*generator\],\)\[\(.*\)\]\(,\[flex-help.*\)$/\2/p" $GITHUB_WORKSPACE/configure.ac) + ver=${ver#v} + ver=${ver%-*} + ver=$ver-$slug + echo "::set-output name=version::$ver" + sed -i "s/^\(AC_INIT.*generator\],\)\(.*\)\(,\[flex-help.*\)$/\1[$ver]\3/" $GITHUB_WORKSPACE/configure.ac + - name: Update CHANGE_LOG + run: | + ./tools/git2cl > $GITHUB_WORKSPACE/ChangeLog + - name: build + run: | + ./autogen.sh + ./configure + make + make check + make distcheck + - name: Make Git archives + env: + ver: ${{ steps.version.outputs.version }} + tagname: ${{ steps.version.outputs.tagname }} + run: | + git archive -o $tagname.tar.gz --prefix=flex-$ver/ HEAD + TZ=America/Los_Angeles git archive -o $tagname.zip --prefix=flex-$ver/ HEAD + echo "SOURCE_GZ="$(echo $ver.src.tar.gz)" >> $GITHUB_ENV + echo "SOURCE_ZIP="$(echo $ver.src.zip)" >> $GITHUB_ENV + - name: Get artifact names + env: + ver: ${{ steps.version.outputs.version }} + tagname: ${{ steps.version.outputs.tagname }} + run: | + echo "ARTIFACT_GZ=$(echo flex-$ver.tar.gz)" >> $GITHUB_ENV + echo "ARTIFACT_LZ=$(echo flex-$ver.tar.lz)" >> $GITHUB_ENV + - name: Upload Nightly tar.gz + id: upload-nightly-asset-gz + uses: actions/upload-artifact@v4 + with: + path: ${{ env.ARTIFACT_GZ }} + name: ${{ env.ARTIFACT_GZ }} + overwrite: true + - name: Upload Nightly tar.lz + id: upload-nightly-asset-lz + uses: actions/upload-artifact@v4 + with: + path: ${{ env.ARTIFACT_LZ }} + name: ${{ env.ARTIFACT_LZ }} + overwrite: true + - name: Upload Nightly src.tar.gz + id: upload-nightly-src-gz + uses: actions/upload-artifact@v4 + with: + path: ${{ env.SOURCE_GZ }} + name: ${{ env.SOURCE_GZ }} + overwrite: true + - name: Upload Nightly src.tar.zip + id: upload-nightly-src-zip + uses: actions/upload-artifact@v4 + with: + path: ${{ env.SOURCE_ZIP }} + name: ${{ env.SOURCE_ZIP }} + overwrite: true From 2699629330dea05113513eee63135c594d436140 Mon Sep 17 00:00:00 2001 From: Joseph Langley Date: Fri, 7 Jun 2024 23:06:03 -0400 Subject: [PATCH 02/15] ci: Change nightly build time --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ee3c64685..0ae417234 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,7 +2,7 @@ name: Nightly on: schedule: - - cron: '14 20 * * *' + - cron: '04 01 * * *' permissions: {} From a69149538db275ec28d29104eca4f45a6e6ea738 Mon Sep 17 00:00:00 2001 From: Joseph Langley Date: Fri, 7 Jun 2024 23:26:11 -0400 Subject: [PATCH 03/15] ci: Add manual trigger to Nightly.yaml --- .github/workflows/nightly.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0ae417234..1d400f83d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,7 +2,8 @@ name: Nightly on: schedule: - - cron: '04 01 * * *' + - cron: '04 00 * * *' + workflow_dispatch: permissions: {} From a9240682b3207103aaffb6e11162ae8513f1f235 Mon Sep 17 00:00:00 2001 From: Joseph Langley Date: Fri, 7 Jun 2024 23:38:36 -0400 Subject: [PATCH 04/15] ci: Correct artifact file names Update deprecated set-output syntax. --- .github/workflows/nightly.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1d400f83d..059c74615 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,7 +12,6 @@ jobs: name: Run a Nightly Build and Save the Artifacts runs-on: ubuntu-20.04 outputs: - tagname: ${{ steps.version.outputs.tagname }} version: ${{ steps.version.outputs.version }} permissions: actions: read @@ -25,12 +24,11 @@ jobs: id: version run: | slug=$(git log -n 1 --pretty='format:%h-%as') - echo "::set-output name=tagname::$slug" ver=$(sed -n "s/^\(AC_INIT.*generator\],\)\[\(.*\)\]\(,\[flex-help.*\)$/\2/p" $GITHUB_WORKSPACE/configure.ac) ver=${ver#v} ver=${ver%-*} ver=$ver-$slug - echo "::set-output name=version::$ver" + echo "version=$ver" >> $GITHUB_OUTPUT sed -i "s/^\(AC_INIT.*generator\],\)\(.*\)\(,\[flex-help.*\)$/\1[$ver]\3/" $GITHUB_WORKSPACE/configure.ac - name: Update CHANGE_LOG run: | @@ -45,16 +43,14 @@ jobs: - name: Make Git archives env: ver: ${{ steps.version.outputs.version }} - tagname: ${{ steps.version.outputs.tagname }} run: | - git archive -o $tagname.tar.gz --prefix=flex-$ver/ HEAD - TZ=America/Los_Angeles git archive -o $tagname.zip --prefix=flex-$ver/ HEAD - echo "SOURCE_GZ="$(echo $ver.src.tar.gz)" >> $GITHUB_ENV - echo "SOURCE_ZIP="$(echo $ver.src.zip)" >> $GITHUB_ENV + git archive -o $ver.src.tar.gz --prefix=flex-$ver/ HEAD + TZ=America/Los_Angeles git archive -o $ver.src.zip --prefix=flex-$ver/ HEAD + echo "SOURCE_GZ=$(echo $ver.src.tar.gz)" >> $GITHUB_ENV + echo "SOURCE_ZIP=$(echo $ver.src.zip)" >> $GITHUB_ENV - name: Get artifact names env: ver: ${{ steps.version.outputs.version }} - tagname: ${{ steps.version.outputs.tagname }} run: | echo "ARTIFACT_GZ=$(echo flex-$ver.tar.gz)" >> $GITHUB_ENV echo "ARTIFACT_LZ=$(echo flex-$ver.tar.lz)" >> $GITHUB_ENV From bcde25eb29549058715bd93195fc3f22b449aafb Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Sat, 8 Jun 2024 12:57:42 -0400 Subject: [PATCH 05/15] ci: Skip nightlies when no changes have been committed. --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/nightly.yml | 46 ++++++++++++++++++++++++--- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e89b83844..313a1c506 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: apt - run: sudo apt-get install gcc autoconf bison gettext autopoint help2man lzip texinfo texlive + run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive - name: autogen run: ./autogen.sh - name: configure diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 41cf11810..882bfe768 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Apt - run: sudo apt-get install gcc autoconf bison gettext autopoint help2man lzip texinfo texlive + run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 059c74615..6f8099ba1 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,37 +12,61 @@ jobs: name: Run a Nightly Build and Save the Artifacts runs-on: ubuntu-20.04 outputs: + update_needed: ${{ steps.update.outputs.needed }} + version_slug: ${{ steps.update.outputs.slug }} version: ${{ steps.version.outputs.version }} permissions: actions: read contents: read steps: - - name: apt - run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive - uses: actions/checkout@v4 + - name: Check time since last commit + id: update + run: | + slug=$(git log -n 1 --pretty='format:%h-%as') + echo "slug=$slug" >> $GITHUB_OUTPUT + authorDate=$(echo $slug | cut -d '-' -f 2-4) + update=1 + [ $(( $(date +%s) - $(date --date=$authorDate +%s) )) -ge 172800 ] && echo "::notice title=No Changes::No changes within the last two days. Skipping nightly build." && update=0 + echo "needed=$update" >> $GITHUB_OUTPUT - name: Change version number id: version + env: + slug: ${{ steps.update.outputs.slug }} + update_needed: ${{ steps.update.outputs.needed }} + if: ${{ env.update_needed == 1 }} run: | - slug=$(git log -n 1 --pretty='format:%h-%as') ver=$(sed -n "s/^\(AC_INIT.*generator\],\)\[\(.*\)\]\(,\[flex-help.*\)$/\2/p" $GITHUB_WORKSPACE/configure.ac) ver=${ver#v} ver=${ver%-*} ver=$ver-$slug echo "version=$ver" >> $GITHUB_OUTPUT sed -i "s/^\(AC_INIT.*generator\],\)\(.*\)\(,\[flex-help.*\)$/\1[$ver]\3/" $GITHUB_WORKSPACE/configure.ac + - name: apt + env: + update_needed: ${{ steps.update.outputs.needed }} + if: ${{ env.update_needed == 1 }} + run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive - name: Update CHANGE_LOG + env: + update_needed: ${{ steps.update.outputs.needed }} + if: ${{ env.update_needed == 1 }} run: | ./tools/git2cl > $GITHUB_WORKSPACE/ChangeLog - name: build + env: + update_needed: ${{ steps.update.outputs.needed }} + if: ${{ env.update_needed == 1 }} run: | ./autogen.sh ./configure make - make check make distcheck - name: Make Git archives env: ver: ${{ steps.version.outputs.version }} + update_needed: ${{ steps.update.outputs.needed }} + if: ${{ env.update_needed == 1 }} run: | git archive -o $ver.src.tar.gz --prefix=flex-$ver/ HEAD TZ=America/Los_Angeles git archive -o $ver.src.zip --prefix=flex-$ver/ HEAD @@ -51,11 +75,16 @@ jobs: - name: Get artifact names env: ver: ${{ steps.version.outputs.version }} + update_needed: ${{ steps.update.outputs.needed }} + if: ${{ env.update_needed == 1 }} run: | echo "ARTIFACT_GZ=$(echo flex-$ver.tar.gz)" >> $GITHUB_ENV echo "ARTIFACT_LZ=$(echo flex-$ver.tar.lz)" >> $GITHUB_ENV - name: Upload Nightly tar.gz id: upload-nightly-asset-gz + env: + update_needed: ${{ steps.update.outputs.needed }} + if: ${{ env.update_needed == 1 }} uses: actions/upload-artifact@v4 with: path: ${{ env.ARTIFACT_GZ }} @@ -63,6 +92,9 @@ jobs: overwrite: true - name: Upload Nightly tar.lz id: upload-nightly-asset-lz + env: + update_needed: ${{ steps.update.outputs.needed }} + if: ${{ env.update_needed == 1 }} uses: actions/upload-artifact@v4 with: path: ${{ env.ARTIFACT_LZ }} @@ -70,6 +102,9 @@ jobs: overwrite: true - name: Upload Nightly src.tar.gz id: upload-nightly-src-gz + env: + update_needed: ${{ steps.update.outputs.needed }} + if: ${{ env.update_needed == 1 }} uses: actions/upload-artifact@v4 with: path: ${{ env.SOURCE_GZ }} @@ -77,6 +112,9 @@ jobs: overwrite: true - name: Upload Nightly src.tar.zip id: upload-nightly-src-zip + env: + update_needed: ${{ steps.update.outputs.needed }} + if: ${{ env.update_needed == 1 }} uses: actions/upload-artifact@v4 with: path: ${{ env.SOURCE_ZIP }} From e580e390eb6ca7f132620207e38a8f8d11541f4a Mon Sep 17 00:00:00 2001 From: Joseph Langley Date: Sun, 30 Jun 2024 01:09:10 -0400 Subject: [PATCH 06/15] ci: Update codeql-analysis.yml to parity with default workflow --- .github/workflows/codeql-analysis.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 882bfe768..55181d64a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -32,7 +32,8 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'cpp' ] + language: c-cpp + build-mode: autobuild # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # Learn more: # 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 @@ -43,21 +44,24 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + # Autobuild expects to start by running configure. + # Run autogen.sh to ensure configure exists. + - name: Autogen + run: | + ./autogen.sh + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 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. # queries: ./path/to/local/query, your-org/your-repo/queries@main - # Autobuild expects to start by running configure. - # Run autogen.sh to ensure configure exists. - - name: Autogen - run: | - ./autogen.sh + # 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) @@ -77,3 +81,5 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 + with: + category: "/language:${{matrix.language}}" From daf235a03b8d500d9e11ec7a66c319b55bf83937 Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Sat, 6 Jul 2024 21:51:20 -0400 Subject: [PATCH 07/15] ci: Upload artifacts to 'nightlies' release Give nightlies workflow permission to write to releases Ensure CodeQL has all Apt requirements --- .github/workflows/codeql-analysis.yml | 85 --------------------------- .github/workflows/codeql.yml | 83 ++++++++++++++++++++++++++ .github/workflows/nightly.yml | 84 ++++++++++++++------------ 3 files changed, 129 insertions(+), 123 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 55181d64a..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,85 +0,0 @@ -# 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" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '31 22 * * 4' - -permissions: read-all - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - security-events: write - - strategy: - fail-fast: false - matrix: - language: c-cpp - build-mode: autobuild - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # 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: Apt - run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive - - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - # Autobuild expects to start by running configure. - # Run autogen.sh to ensure configure exists. - - name: Autogen - run: | - ./autogen.sh - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 - 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. - # 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: Autobuild - uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following four lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - #- name: Build - # run: | - # ./configure - # make - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..a84125be4 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,83 @@ +# 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" + +on: + push: + branches: [ "nightly-build" ] + pull_request: + branches: [ "nightly-build" ] + schedule: + - cron: '39 5 * * 5' + +permissions: {} + +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: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: c-cpp + build-mode: autobuild + # 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + # Ensure autopoint is installed. CodeQL misses it sometimes. + - name: apt + run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 + 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. + + # 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 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6f8099ba1..6142077a5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -17,7 +17,7 @@ jobs: version: ${{ steps.version.outputs.version }} permissions: actions: read - contents: read + contents: write steps: - uses: actions/checkout@v4 - name: Check time since last commit @@ -80,43 +80,51 @@ jobs: run: | echo "ARTIFACT_GZ=$(echo flex-$ver.tar.gz)" >> $GITHUB_ENV echo "ARTIFACT_LZ=$(echo flex-$ver.tar.lz)" >> $GITHUB_ENV - - name: Upload Nightly tar.gz - id: upload-nightly-asset-gz +# - name: Upload Nightly tar.gz +# id: upload-nightly-asset-gz +# env: +# update_needed: ${{ steps.update.outputs.needed }} +# if: ${{ env.update_needed == 1 }} +# uses: actions/upload-artifact@v4 +# with: +# path: ${{ env.ARTIFACT_GZ }} +# name: ${{ env.ARTIFACT_GZ }} +# overwrite: true +# - name: Upload Nightly tar.lz +# id: upload-nightly-asset-lz +# env: +# update_needed: ${{ steps.update.outputs.needed }} +# if: ${{ env.update_needed == 1 }} +# uses: actions/upload-artifact@v4 +# with: +# path: ${{ env.ARTIFACT_LZ }} +# name: ${{ env.ARTIFACT_LZ }} +# overwrite: true +# - name: Upload Nightly src.tar.gz +# id: upload-nightly-src-gz +# env: +# update_needed: ${{ steps.update.outputs.needed }} +# if: ${{ env.update_needed == 1 }} +# uses: actions/upload-artifact@v4 +# with: +# path: ${{ env.SOURCE_GZ }} +# name: ${{ env.SOURCE_GZ }} +# overwrite: true +# - name: Upload Nightly src.tar.zip +# id: upload-nightly-src-zip +# env: +# update_needed: ${{ steps.update.outputs.needed }} +# if: ${{ env.update_needed == 1 }} +# uses: actions/upload-artifact@v4 +# with: +# path: ${{ env.SOURCE_ZIP }} +# name: ${{ env.SOURCE_ZIP }} +# overwrite: true + - name: Upload Artifacts to Nightlies Release + id: upload-nightly-artifacts env: update_needed: ${{ steps.update.outputs.needed }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} if: ${{ env.update_needed == 1 }} - uses: actions/upload-artifact@v4 - with: - path: ${{ env.ARTIFACT_GZ }} - name: ${{ env.ARTIFACT_GZ }} - overwrite: true - - name: Upload Nightly tar.lz - id: upload-nightly-asset-lz - env: - update_needed: ${{ steps.update.outputs.needed }} - if: ${{ env.update_needed == 1 }} - uses: actions/upload-artifact@v4 - with: - path: ${{ env.ARTIFACT_LZ }} - name: ${{ env.ARTIFACT_LZ }} - overwrite: true - - name: Upload Nightly src.tar.gz - id: upload-nightly-src-gz - env: - update_needed: ${{ steps.update.outputs.needed }} - if: ${{ env.update_needed == 1 }} - uses: actions/upload-artifact@v4 - with: - path: ${{ env.SOURCE_GZ }} - name: ${{ env.SOURCE_GZ }} - overwrite: true - - name: Upload Nightly src.tar.zip - id: upload-nightly-src-zip - env: - update_needed: ${{ steps.update.outputs.needed }} - if: ${{ env.update_needed == 1 }} - uses: actions/upload-artifact@v4 - with: - path: ${{ env.SOURCE_ZIP }} - name: ${{ env.SOURCE_ZIP }} - overwrite: true + run: | + gh release upload nightlies ${{ env.ARTIFACT_GZ }} ${{ env.ARTIFACT_LZ }} ${{ env.SOURCE_GZ }} ${{ env.SOURCE_ZIP }} --clobber From 2170a76b5683669e702910709b6c11b0cd4830af Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Mon, 6 Jan 2025 15:53:47 -0500 Subject: [PATCH 08/15] ci: Revert name of codeql-analysis.yml --- .github/workflows/{codeql.yml => codeql-analysis.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{codeql.yml => codeql-analysis.yml} (100%) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql-analysis.yml similarity index 100% rename from .github/workflows/codeql.yml rename to .github/workflows/codeql-analysis.yml From ad1ccb8eed1b32f841734d27992ec2364c1d2c77 Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Mon, 6 Jan 2025 15:57:53 -0500 Subject: [PATCH 09/15] ci: Fix image and action version numbers. Remove dead code. --- .github/workflows/nightly.yml | 46 +++-------------------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6142077a5..4b6a65894 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,7 +10,7 @@ permissions: {} jobs: nightly: name: Run a Nightly Build and Save the Artifacts - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest outputs: update_needed: ${{ steps.update.outputs.needed }} version_slug: ${{ steps.update.outputs.slug }} @@ -19,7 +19,7 @@ jobs: actions: read contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Check time since last commit id: update run: | @@ -80,47 +80,7 @@ jobs: run: | echo "ARTIFACT_GZ=$(echo flex-$ver.tar.gz)" >> $GITHUB_ENV echo "ARTIFACT_LZ=$(echo flex-$ver.tar.lz)" >> $GITHUB_ENV -# - name: Upload Nightly tar.gz -# id: upload-nightly-asset-gz -# env: -# update_needed: ${{ steps.update.outputs.needed }} -# if: ${{ env.update_needed == 1 }} -# uses: actions/upload-artifact@v4 -# with: -# path: ${{ env.ARTIFACT_GZ }} -# name: ${{ env.ARTIFACT_GZ }} -# overwrite: true -# - name: Upload Nightly tar.lz -# id: upload-nightly-asset-lz -# env: -# update_needed: ${{ steps.update.outputs.needed }} -# if: ${{ env.update_needed == 1 }} -# uses: actions/upload-artifact@v4 -# with: -# path: ${{ env.ARTIFACT_LZ }} -# name: ${{ env.ARTIFACT_LZ }} -# overwrite: true -# - name: Upload Nightly src.tar.gz -# id: upload-nightly-src-gz -# env: -# update_needed: ${{ steps.update.outputs.needed }} -# if: ${{ env.update_needed == 1 }} -# uses: actions/upload-artifact@v4 -# with: -# path: ${{ env.SOURCE_GZ }} -# name: ${{ env.SOURCE_GZ }} -# overwrite: true -# - name: Upload Nightly src.tar.zip -# id: upload-nightly-src-zip -# env: -# update_needed: ${{ steps.update.outputs.needed }} -# if: ${{ env.update_needed == 1 }} -# uses: actions/upload-artifact@v4 -# with: -# path: ${{ env.SOURCE_ZIP }} -# name: ${{ env.SOURCE_ZIP }} -# overwrite: true - - name: Upload Artifacts to Nightlies Release + - name: Upload Artifacts to Nightlies Release id: upload-nightly-artifacts env: update_needed: ${{ steps.update.outputs.needed }} From f4eec640151e6ea16b603c53e1158bbeb5045786 Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Mon, 6 Jan 2025 16:33:58 -0500 Subject: [PATCH 10/15] ci: Specify build image version --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4b6a65894..ef27b18c1 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,7 +10,7 @@ permissions: {} jobs: nightly: name: Run a Nightly Build and Save the Artifacts - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 outputs: update_needed: ${{ steps.update.outputs.needed }} version_slug: ${{ steps.update.outputs.slug }} From fda3f622cbe8cbc3018d9dd5b74405baf4e16d4a Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Mon, 6 Jan 2025 16:54:01 -0500 Subject: [PATCH 11/15] ci: Reset default branch name for CodeQL --- .github/workflows/codeql-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a84125be4..c447290ce 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,9 +13,9 @@ name: "CodeQL" on: push: - branches: [ "nightly-build" ] + branches: [ "master" ] pull_request: - branches: [ "nightly-build" ] + branches: [ "master" ] schedule: - cron: '39 5 * * 5' From d78d8a02c3948daf0d630e4b1da13bf69acc4449 Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Mon, 6 Jan 2025 17:29:49 -0500 Subject: [PATCH 12/15] ci: Don't install Flex or Bison --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ef27b18c1..59e61b0b3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -46,7 +46,7 @@ jobs: env: update_needed: ${{ steps.update.outputs.needed }} if: ${{ env.update_needed == 1 }} - run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive + run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool gettext autopoint help2man lzip texinfo texlive - name: Update CHANGE_LOG env: update_needed: ${{ steps.update.outputs.needed }} From edecb3db83b6798d8264f884c3ce261edc45eda5 Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Mon, 6 Jan 2025 17:32:07 -0500 Subject: [PATCH 13/15] ci: Fixed missing space L83 --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 59e61b0b3..ade348118 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -80,7 +80,7 @@ jobs: run: | echo "ARTIFACT_GZ=$(echo flex-$ver.tar.gz)" >> $GITHUB_ENV echo "ARTIFACT_LZ=$(echo flex-$ver.tar.lz)" >> $GITHUB_ENV - - name: Upload Artifacts to Nightlies Release + - name: Upload Artifacts to Nightlies Release id: upload-nightly-artifacts env: update_needed: ${{ steps.update.outputs.needed }} From 3faf2b3380c0a59b5caecad72043bfb594773837 Mon Sep 17 00:00:00 2001 From: Mightyjo Date: Tue, 7 Jan 2025 13:15:18 -0500 Subject: [PATCH 14/15] ci: Don't install Flex/Bison via Apt. Fix build image version numbers. --- .github/workflows/build.yml | 4 ++-- .github/workflows/codeql-analysis.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 313a1c506..be8fc98c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,12 +13,12 @@ permissions: read-all jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: apt - run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive + run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool gettext autopoint help2man lzip texinfo texlive - name: autogen run: ./autogen.sh - name: configure diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c447290ce..c01d11906 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -29,7 +29,7 @@ jobs: # - 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: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-22.04' }} timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} permissions: # required for all workflows @@ -62,7 +62,7 @@ jobs: # Ensure autopoint is installed. CodeQL misses it sometimes. - name: apt - run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool flex bison gettext autopoint help2man lzip texinfo texlive + run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool gettext autopoint help2man lzip texinfo texlive # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 3b7b64993465fe6d4076f3ddf8b60365d98fe6fb Mon Sep 17 00:00:00 2001 From: Joseph Langley Date: Tue, 7 Jan 2025 16:25:47 -0500 Subject: [PATCH 15/15] ci: Remove Swift references from CodeQL Lower CodeQL timeout to 240 minutes. --- .github/workflows/codeql-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c01d11906..b8281b5c9 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -29,8 +29,8 @@ jobs: # - 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: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-22.04' }} - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + runs-on: ubuntu-22.04 + timeout-minutes: 240 permissions: # required for all workflows security-events: write