From 30c6b3a1abd8bea86ade97bbc11883743f3f6c2c Mon Sep 17 00:00:00 2001 From: misodengaku Date: Wed, 8 Nov 2023 17:30:56 +0900 Subject: [PATCH] python: github actions --- .github/workflows/python.yml | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/python.yml diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 000000000..f8bcd8fa1 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,74 @@ +name: Python CI +on: + push: + branches: [main] + paths: + - bench/**/* + - webapp/python/**/* + - webapp/sql/**/* + - development/docker-compose-common.yml + - development/docker-compose-python.yml + - development/Makefile + - .github/workflows/python.yml + pull_request: + paths: + - bench/**/* + - webapp/python/**/* + - webapp/sql/**/* + - development/docker-compose-common.yml + - development/docker-compose-python.yml + - development/Makefile + - .github/workflows/python.yml + workflow_dispatch: +jobs: + test: + strategy: + matrix: + go: + - 1.21.1 + name: Build + runs-on: [isucon13-ci-06] + steps: + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + id: go + + # to avoid error: Deleting the contents of '/home/ubuntu/actions-runner/_work/isucon13/isucon13' + # Error: File was unable to be removed Error: EACCES: permission denied, rmdir + # https://github.com/actions/checkout/issues/211 + - name: chown workdir + run: + sudo chown -R $USER:$USER $GITHUB_WORKSPACE + + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + + # containers + - name: "setup containers" + working-directory: ./development + run: | + make down/python + make up/python + + # bench + - name: "[bench] Get deps" + working-directory: ./bench + env: + TZ: Asia/Tokyo + run: | + go get -v -t -d ./... + + - name: "[bench] Test" + working-directory: ./bench + env: + TZ: Asia/Tokyo + run: | + go clean -testcache + go test -p=1 -v ./... + + - name: "run bench" + working-directory: ./bench + run: | + make bench