Skip to content

Commit

Permalink
Merge pull request #22 from python-discord/repo-token-remove
Browse files Browse the repository at this point in the history
`REPO_TOKEN` is no more.
  • Loading branch information
ChrisLovering committed Oct 13, 2022
2 parents c142f98 + 5e84c5e commit 37de243
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 57 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
tag=$(cut -c 1-7 <<< $GITHUB_SHA)
echo "::set-output name=tag::$tag"
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

# The current version (v2) of Docker's build-push action uses
# buildx, which comes with BuildKit features that help us speed
Expand Down Expand Up @@ -77,10 +77,9 @@ jobs:
# Check out the private "kubernetes" repository in the `kubernetes`
# subdirectory using a GitHub Personal Access Token
- name: Checkout Kubernetes Repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: python-discord/kubernetes
token: ${{ secrets.REPO_TOKEN }}
path: kubernetes

- name: Authenticate with Kubernetes
Expand Down
60 changes: 6 additions & 54 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,65 +29,17 @@ jobs:
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
env:
# Configure pip to cache dependencies and do a user install
PIP_NO_CACHE_DIR: false
PIP_USER: 1

# Make sure package manager does not use virtualenv
POETRY_VIRTUALENVS_CREATE: false

# Specify explicit paths for python dependencies and the pre-commit
# environment so we know which directories to cache
POETRY_CACHE_DIR: ${{ github.workspace }}/.cache/py-user-base
PYTHONUSERBASE: ${{ github.workspace }}/.cache/py-user-base
PRE_COMMIT_HOME: ${{ github.workspace }}/.cache/pre-commit-cache

steps:
- name: Add custom PYTHONUSERBASE to PATH
run: echo '${{ env.PYTHONUSERBASE }}/bin/' >> $GITHUB_PATH

- name: Checkout repository
uses: actions/checkout@v2

- name: Setup python
id: python
uses: actions/setup-python@v2
with:
python-version: '3.9.5'

# This step caches our Python dependencies. To make sure we
# only restore a cache when the dependencies, the python version,
# the runner operating system, and the dependency location haven't
# changed, we create a cache key that is a composite of those states.
#
# Only when the context is exactly the same, we will restore the cache.
- name: Python Dependency Caching
uses: actions/cache@v2
id: python_cache
with:
path: ${{ env.PYTHONUSERBASE }}
key: "python-0-${{ runner.os }}-${{ env.PYTHONUSERBASE }}-\
${{ steps.python.outputs.python-version }}-\
${{ hashFiles('./pyproject.toml', './poetry.lock') }}"

# Install our dependencies if we did not restore a dependency cache
- name: Install dependencies using Poetry
if: steps.python_cache.outputs.cache-hit != 'true'
run: |
pip install poetry
poetry install
uses: actions/checkout@v3

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

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

0 comments on commit 37de243

Please sign in to comment.