diff options
author | DudeNr33 <3929834+DudeNr33@users.noreply.github.com> | 2022-07-17 17:30:56 +0200 |
---|---|---|
committer | Andreas Finkler <3929834+DudeNr33@users.noreply.github.com> | 2022-07-17 18:13:46 +0200 |
commit | 09a0ce221db656a59f6261ccb3bb1bc22645769a (patch) | |
tree | f50f3faec258393a622517dedca3f9c6da02fc23 | |
parent | 1d2f0ef6cca6566ed8c1c5817ee8f22ec3365e93 (diff) | |
download | pylint-git-09a0ce221db656a59f6261ccb3bb1bc22645769a.tar.gz |
Create pipeline for checking existence of changelog and update cache version
-rw-r--r-- | .github/workflows/changelog.yml | 62 | ||||
-rw-r--r-- | .github/workflows/checks.yaml | 2 | ||||
-rw-r--r-- | .github/workflows/primer-test.yaml | 2 | ||||
-rw-r--r-- | .github/workflows/primer_comment.yaml | 2 | ||||
-rw-r--r-- | .github/workflows/primer_run_main.yaml | 2 | ||||
-rw-r--r-- | .github/workflows/primer_run_pr.yaml | 2 | ||||
-rw-r--r-- | .github/workflows/tests.yaml | 2 | ||||
-rw-r--r-- | .readthedocs.yaml | 3 |
8 files changed, 71 insertions, 6 deletions
diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 000000000..7dbbbd31f --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,62 @@ +name: changelog + +on: + pull_request: + types: [opened, synchronize, labeled, unlabeled, reopened] + +env: + # Also change CACHE_VERSION in the other workflows + CACHE_VERSION: 20 + DEFAULT_PYTHON: "3.10" + +jobs: + check-changelog: + if: contains(github.event.pull_request.labels.*.name, 'skip news :mute:') != true + name: Changelog Entry Check + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Check out code from GitHub + uses: actions/checkout@v3.0.2 + with: + # `towncrier check` runs `git diff --name-only origin/main...`, which + # needs a non-shallow clone. + fetch-depth: 0 + - name: Set up Python ${{ env.DEFAULT_PYTHON }} + id: python + uses: actions/setup-python@v4.0.0 + with: + python-version: ${{ env.DEFAULT_PYTHON }} + - name: Generate partial Python venv restore key + id: generate-python-key + run: >- + echo "::set-output name=key::base-venv-${{ env.CACHE_VERSION }}-${{ + hashFiles('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt') + }}" + - name: Restore Python virtual environment + id: cache-venv + uses: actions/cache@v3.0.4 + with: + path: venv + key: >- + ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ + steps.generate-python-key.outputs.key }} + restore-keys: | + ${{ runner.os }}-${{ steps.python.outputs.python-version }}-base-venv-${{ env.CACHE_VERSION }}- + - name: Create Python virtual environment + if: steps.cache-venv.outputs.cache-hit != 'true' + run: | + python -m venv venv + . venv/bin/activate + python -m pip install -U pip setuptools wheel + pip install -U -r requirements_test.txt + pip install -U -r doc/requirements.txt + - name: Emit warning if news fragment is missing + env: + BASE_BRANCH: ${{ github.base_ref }} + run: | + # Fetch the pull request' base branch so towncrier will be able to + # compare the current branch with the base branch. + git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH} + . venv/bin/activate + towncrier check --compare-with origin/${{ github.base_ref }} diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index adc2e10c8..196a0115b 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -8,7 +8,7 @@ on: pull_request: ~ env: - CACHE_VERSION: 1 + CACHE_VERSION: 20 DEFAULT_PYTHON: "3.10" PRE_COMMIT_CACHE: ~/.cache/pre-commit diff --git a/.github/workflows/primer-test.yaml b/.github/workflows/primer-test.yaml index bda9f51f1..a6a4ce424 100644 --- a/.github/workflows/primer-test.yaml +++ b/.github/workflows/primer-test.yaml @@ -13,7 +13,7 @@ on: - ".github/workflows/primer-test.yaml" env: - CACHE_VERSION: 1 + CACHE_VERSION: 20 concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/primer_comment.yaml b/.github/workflows/primer_comment.yaml index ebef77e77..3114db3f9 100644 --- a/.github/workflows/primer_comment.yaml +++ b/.github/workflows/primer_comment.yaml @@ -13,7 +13,7 @@ on: - completed env: - CACHE_VERSION: 1 + CACHE_VERSION: 20 permissions: contents: read diff --git a/.github/workflows/primer_run_main.yaml b/.github/workflows/primer_run_main.yaml index c231e1ff2..8482c512e 100644 --- a/.github/workflows/primer_run_main.yaml +++ b/.github/workflows/primer_run_main.yaml @@ -15,7 +15,7 @@ concurrency: cancel-in-progress: true env: - CACHE_VERSION: 1 + CACHE_VERSION: 20 jobs: run-primer: diff --git a/.github/workflows/primer_run_pr.yaml b/.github/workflows/primer_run_pr.yaml index efe88c05c..c3f039ed6 100644 --- a/.github/workflows/primer_run_pr.yaml +++ b/.github/workflows/primer_run_pr.yaml @@ -24,7 +24,7 @@ concurrency: cancel-in-progress: true env: - CACHE_VERSION: 1 + CACHE_VERSION: 20 jobs: run-primer: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dfae0e72c..4fbe0b1b3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -10,7 +10,7 @@ on: - doc/data/messages/** env: - CACHE_VERSION: 1 + CACHE_VERSION: 20 jobs: tests-linux: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 0fec8925d..9f7c35450 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -14,3 +14,6 @@ build: os: ubuntu-20.04 tools: python: "3.8" + jobs: + pre_build: + - towncrier build --yes --date TBA |