Skip to content

Commit 5e84c5e

Browse files
committed
Update lint flow to use Scale's setup Python
1 parent e42a13f commit 5e84c5e

File tree

2 files changed

+8
-56
lines changed

2 files changed

+8
-56
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
tag=$(cut -c 1-7 <<< $GITHUB_SHA)
2727
echo "::set-output name=tag::$tag"
2828
- name: Checkout code
29-
uses: actions/checkout@v2
29+
uses: actions/checkout@v3
3030

3131
# The current version (v2) of Docker's build-push action uses
3232
# buildx, which comes with BuildKit features that help us speed
@@ -77,7 +77,7 @@ jobs:
7777
# Check out the private "kubernetes" repository in the `kubernetes`
7878
# subdirectory using a GitHub Personal Access Token
7979
- name: Checkout Kubernetes Repository
80-
uses: actions/checkout@v2
80+
uses: actions/checkout@v3
8181
with:
8282
repository: python-discord/kubernetes
8383
path: kubernetes

.github/workflows/lint-test.yaml

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -29,65 +29,17 @@ jobs:
2929
ports:
3030
# Maps tcp port 5432 on service container to the host
3131
- 5432:5432
32-
env:
33-
# Configure pip to cache dependencies and do a user install
34-
PIP_NO_CACHE_DIR: false
35-
PIP_USER: 1
36-
37-
# Make sure package manager does not use virtualenv
38-
POETRY_VIRTUALENVS_CREATE: false
39-
40-
# Specify explicit paths for python dependencies and the pre-commit
41-
# environment so we know which directories to cache
42-
POETRY_CACHE_DIR: ${{ github.workspace }}/.cache/py-user-base
43-
PYTHONUSERBASE: ${{ github.workspace }}/.cache/py-user-base
44-
PRE_COMMIT_HOME: ${{ github.workspace }}/.cache/pre-commit-cache
4532

4633
steps:
47-
- name: Add custom PYTHONUSERBASE to PATH
48-
run: echo '${{ env.PYTHONUSERBASE }}/bin/' >> $GITHUB_PATH
49-
5034
- name: Checkout repository
51-
uses: actions/checkout@v2
52-
53-
- name: Setup python
54-
id: python
55-
uses: actions/setup-python@v2
56-
with:
57-
python-version: '3.9.5'
58-
59-
# This step caches our Python dependencies. To make sure we
60-
# only restore a cache when the dependencies, the python version,
61-
# the runner operating system, and the dependency location haven't
62-
# changed, we create a cache key that is a composite of those states.
63-
#
64-
# Only when the context is exactly the same, we will restore the cache.
65-
- name: Python Dependency Caching
66-
uses: actions/cache@v2
67-
id: python_cache
68-
with:
69-
path: ${{ env.PYTHONUSERBASE }}
70-
key: "python-0-${{ runner.os }}-${{ env.PYTHONUSERBASE }}-\
71-
${{ steps.python.outputs.python-version }}-\
72-
${{ hashFiles('./pyproject.toml', './poetry.lock') }}"
73-
74-
# Install our dependencies if we did not restore a dependency cache
75-
- name: Install dependencies using Poetry
76-
if: steps.python_cache.outputs.cache-hit != 'true'
77-
run: |
78-
pip install poetry
79-
poetry install
35+
uses: actions/checkout@v3
8036

81-
# This step caches our pre-commit environment. To make sure we
82-
# do create a new environment when our pre-commit setup changes,
83-
# we create a cache key based on relevant factors.
84-
- name: Pre-commit Environment Caching
85-
uses: actions/cache@v2
37+
- name: Install Python Dependencies
38+
uses: HassanAbouelela/actions/setup-python@setup-python_v1.3.2
8639
with:
87-
path: ${{ env.PRE_COMMIT_HOME }}
88-
key: "precommit-0-${{ runner.os }}-${{ env.PRE_COMMIT_HOME }}-\
89-
${{ steps.python.outputs.python-version }}-\
90-
${{ hashFiles('./.pre-commit-config.yaml') }}"
40+
# Set dev=true to install flake8 extensions, which are dev dependencies
41+
dev: true
42+
python_version: '3.9'
9143

9244
# We will not run `flake8` here, as we will use a separate flake8
9345
# action. As pre-commit does not support user installs, we set

0 commit comments

Comments
 (0)