Merge pull request #792 from isucon/fix-log #433
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
name: Python CI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- bench/**/* | |
- webapp/python/**/* | |
- .github/workflows/python.yml | |
- development/compose-python.yml | |
- development/dockerfiles/Dockerfile.python | |
pull_request: | |
paths: | |
- bench/**/* | |
- webapp/python/**/* | |
- .github/workflows/python.yml | |
- development/compose-python.yml | |
- development/dockerfiles/Dockerfile.python | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint | |
runs-on: codebuild-problem-github-actions-${{ github.run_id }}-${{ github.run_attempt }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- name: Install nox | |
run: | | |
python -m pip install nox | |
env: | |
PIP_ROOT_USER_ACTION: ignore | |
- name: Run nox | |
working-directory: ./webapp/python | |
run: | | |
nox | |
build: | |
name: Build | |
runs-on: codebuild-problem-github-actions-${{ github.run_id }}-${{ github.run_attempt }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'bench/go.mod' | |
cache-dependency-path: | | |
./bench/go.sum | |
- name: Install Task | |
uses: arduino/setup-task@v2 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/setup-buildx-action@v3 | |
with: | |
driver-opts: image=mirror.gcr.io/moby/buildkit:buildx-stable-1 | |
buildkitd-config-inline: | | |
[registry."docker.io"] | |
mirrors = ["mirror.gcr.io"] | |
- name: Build webapp | |
uses: docker/bake-action@v5 | |
with: | |
push: false | |
load: true | |
workdir: ./development | |
files: compose-python.yml | |
set: | | |
webapp.cache-from=type=gha,scope=webapp-python-cache | |
webapp.cache-to=type=gha,scope=webapp-python-cache,mode=max | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 9 | |
run_install: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
cache-dependency-path: "frontend/pnpm-lock.yaml" | |
- name: Build bench | |
working-directory: ./bench | |
run: | | |
task gen-frontend | |
task build | |
- name: Setup webapp/python | |
working-directory: ./development | |
run: | | |
sudo docker compose -f compose-python.yml up -d --wait | |
- name: Run bench | |
working-directory: ./bench | |
run: | | |
task run-local -- --fail-on-error --payment-url http://host.docker.internal:12345 | |
- name: Down webapp/go | |
working-directory: ./development | |
if: ${{ always() }} | |
run: | | |
sudo docker compose -f compose-python.yml down -v |