-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* lets just try dockah * here * hm? * ghcr? * login * use da cache * hehe * f * perms * big dumb * oh lala * hipshot * ? * that's no kubes * oh yeah * connect up da services * oh that is simpler * paths? * restore da matrix, neo * hmmmmm * don't locale me * maybe bash * omfg * straws! * restore matrix, neo * hmmmmmmmmmm * ooo * hold on docs 4 now * split up docs stuff * GHA doesn't have git anymore * i hate this uid/gidshit * 🤦 * just skip for now * whoami * pro * allup * CI!!! * cache it all * Revert "GHA doesn't have git anymore" This reverts commit 157441b. * mount the whole shebang * env in container * wront spot * argumentsssss * am fog * hm * no? * when in doubt * ? * ? * set it aside for now * okay now to fight git? * hold * ref: actions/checkout#1487 * allup * byapss * validate * No, I will not be squashing all that, witness my garbage. * not sure if neccessary * too slow and doesn't capture RUN caches anyway * nose clean * no, we wanted that :) * oh, right this is what enables the gha docker cache * more caching cannot hurt * test cachin * oh, right * Revert "test cachin" This reverts commit f03fd35. * test all the caches * test the caches * test cache * test caching and validate deps task * test test test * reverts * test code only change * does caching work in container runs? * revert test change
- Loading branch information
Showing
5 changed files
with
85 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,60 +9,102 @@ on: | |
workflow_dispatch: # generally only for the "combine-prs" workflow | ||
permissions: | ||
contents: read | ||
packages: read | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
jobs: | ||
deps: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Install platform dependencies | ||
run: | | ||
sudo apt -y update | ||
sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config libxml2-dev libxslt-dev | ||
- uses: actions/setup-python@v5 | ||
- name: Expose GitHub Runtime | ||
uses: crazy-max/ghaction-github-runtime@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Cache RUN --mount=type=cache /var/cache/apt | ||
uses: actions/cache@v3 | ||
with: | ||
python-version-file: '.python-version' | ||
- name: pip cache | ||
uses: actions/cache@v4 | ||
path: var-cache-apt | ||
key: var-cache-apt-${{ hashFiles('Dockerfile') }} | ||
restore-keys: | | ||
var-cache-apt- | ||
- name: Cache RUN --mount=type=cache /var/lib/apt | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-${{ runner.os }} | ||
- name: Cache built Python environment | ||
uses: actions/cache@v4 | ||
path: var-lib-apt | ||
key: var-lib-apt-${{ hashFiles('Dockerfile') }} | ||
restore-keys: | | ||
var-lib-apt- | ||
- name: Cache RUN --mount=type=cache /root/.cache/pip | ||
uses: actions/cache@v3 | ||
with: | ||
path: root-cache-pip | ||
key: root-cache-pip-${{ hashFiles('requirements/*.txt') }} | ||
restore-keys: | | ||
root-cache-pip- | ||
- name: Cache RUN --mount=type=cache /root/.npm | ||
uses: actions/cache@v3 | ||
with: | ||
path: root-npm | ||
key: root-npm-${{ hashFiles('package.json', 'package-lock.json') }} | ||
restore-keys: | | ||
root-npm- | ||
- name: inject var-cache-apt into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} | ||
- name: Install Python dependencies | ||
cache-source: var-cache-apt | ||
cache-target: /var/cache/apt | ||
skip-extraction: ${{ steps.cache-var-cache-apt.outputs.cache-hit }} | ||
- name: inject var-lib-apt into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-source: var-lib-apt | ||
cache-target: /var/lib/apt | ||
skip-extraction: ${{ steps.cache-var-lib-apt.outputs.cache-hit }} | ||
- name: inject root-cache-pip into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-source: root-cache-pip | ||
cache-target: /root/.cache/pip | ||
skip-extraction: ${{ steps.cache-root-cache-pip.outputs.cache-hit }} | ||
- name: inject root-npm into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-source: root-npm | ||
cache-target: /root/.npm | ||
skip-extraction: ${{ steps.cache-root-npm.outputs.cache-hit }} | ||
- name: Build Docker Image | ||
run: | | ||
pip install -U setuptools wheel pip | ||
pip install -r requirements.txt --no-deps | ||
pip install -r requirements/dev.txt | ||
pip check | ||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin | ||
docker buildx build --build-arg="DEVEL=yes" --build-arg="CI=yes" --cache-to type=gha,mode=max --cache-from type=gha --push -t ghcr.io/pypi/warehouse:ci-${{ github.run_id }} . | ||
test: | ||
# Time out if our test suite has gotten hung | ||
timeout-minutes: 15 | ||
needs: deps | ||
needs: build | ||
strategy: | ||
matrix: | ||
include: | ||
- name: Tests | ||
command: bin/tests --postgresql-host localhost | ||
command: bin/tests --postgresql-host postgres | ||
- name: Lint | ||
command: bin/lint | ||
- name: User Documentation | ||
command: bin/user-docs | ||
- name: Developer Documentation | ||
command: bin/dev-docs | ||
- name: Dependencies | ||
command: bin/github-actions-deps | ||
command: bin/deps | ||
- name: Licenses | ||
command: bin/licenses | ||
- name: Translations | ||
command: bin/translations | ||
- name: User Documentation | ||
command: bin/user-docs | ||
- name: Developer Documentation | ||
command: bin/dev-docs | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/pypi/warehouse:ci-${{ github.run_id }} | ||
env: | ||
BILLING_BACKEND: warehouse.subscriptions.services.MockStripeBillingService api_base=http://stripe:12111 api_version=2020-08-27 | ||
services: | ||
postgres: | ||
image: ${{ (matrix.name == 'Tests') && 'postgres:14.11' || '' }} | ||
|
@@ -77,31 +119,15 @@ jobs: | |
ports: | ||
- 12111:12111 | ||
name: ${{ matrix.name }} | ||
env: | ||
BILLING_BACKEND: warehouse.subscriptions.services.MockStripeBillingService api_base=http://localhost:12111 api_version=2020-08-27 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Install platform dependencies | ||
run: | | ||
sudo apt -y update | ||
sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config libxml2-dev libxslt-dev | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: '.python-version' | ||
- name: Cache mypy results | ||
if: ${{ (matrix.name == 'Lint') }} | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
dev/.mypy_cache | ||
key: ${{ runner.os }}-mypy-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} | ||
- name: Restore built Python environment from deps | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} | ||
# Since we don't install deps again, we fail if we can't restore the cache (timeout, etc) | ||
fail-on-cache-miss: true | ||
key: ${{ runner.os }}-mypy-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} | ||
- name: Run ${{ matrix.name }} | ||
run: ${{ matrix.command }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters