From 3161f99c6fbcccd68355016677a38c5fcea3bf2e Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 18 Sep 2022 10:42:06 -0500 Subject: [PATCH 1/3] ci(codeql-analysis): Update action versions, cleanup --- .github/workflows/codeql-analysis.yml | 49 ++++----------------------- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2341f6dad..5da69bd96 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,24 +1,12 @@ -# 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: '21 7 * * 4' + - cron: '16 5 * * 2' jobs: analyze: @@ -29,42 +17,17 @@ jobs: contents: read security-events: write - strategy: - fail-fast: false - matrix: - language: [ 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + 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 + languages: "python" - # 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@v1 - - # â„šī¸ 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 - - #- run: | - # make bootstrap - # make release + uses: github/codeql-action/autobuild@v2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 From a52d556419b3f0fd9063210cd9914a5435332ca9 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 18 Sep 2022 10:43:43 -0500 Subject: [PATCH 2/3] ci(tests): Only pull docker image on release (after tests pass) --- .github/workflows/tests.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 335326e03..81b772ffa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,6 +52,27 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} + release: + runs-on: ubuntu-latest + needs: build + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + + strategy: + matrix: + python-version: ["3.10"] + + steps: + - uses: actions/checkout@v3 + + - name: Install poetry + run: pipx install "poetry==1.1.15" + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'poetry' + - name: Build package if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') run: poetry build From b117d012be7495a22375795279f0f5b29870db1a Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 18 Sep 2022 10:45:12 -0500 Subject: [PATCH 3/3] docs(CHANGES): Note CI updates --- CHANGES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index dc15b2963..44ec85f59 100644 --- a/CHANGES +++ b/CHANGES @@ -29,6 +29,14 @@ $ pip install --user --upgrade --pre libvcs - Improve doc examples / tests for `keygetter` and `QueryList` to show deep lookups for objects (#415) +### Infrastructure + +- CI speedups (#416) + + - Avoid fetching unused apt package + - Split out release to separate job so the PyPI Upload docker image isn't pulled on normal runs + - Clean up CodeQL + ## libvcs 0.16.2 (2022-09-11) ### Bug fix