Update ci action versions and avoid make ci install deps twice

This commit is contained in:
Waket Zheng 2024-06-01 20:46:08 +08:00
parent 51117867a6
commit 716638752b
3 changed files with 11 additions and 8 deletions

View File

@ -21,8 +21,8 @@ jobs:
steps: steps:
- name: Start MySQL - name: Start MySQL
run: sudo systemctl start mysql.service run: sudo systemctl start mysql.service
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- uses: actions/setup-python@v2 - uses: actions/setup-python@v5
with: with:
python-version: '3.x' python-version: '3.x'
- name: Install and configure Poetry - name: Install and configure Poetry

View File

@ -7,8 +7,8 @@ jobs:
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- uses: actions/setup-python@v2 - uses: actions/setup-python@v5
with: with:
python-version: '3.x' python-version: '3.x'
- name: Install and configure Poetry - name: Install and configure Poetry

View File

@ -14,13 +14,15 @@ up:
deps: deps:
@poetry install -E asyncpg -E asyncmy @poetry install -E asyncpg -E asyncmy
style: deps _style:
@isort -src $(checkfiles) @isort -src $(checkfiles)
@black $(black_opts) $(checkfiles) @black $(black_opts) $(checkfiles)
style: deps _style
check: deps _check:
@black --check $(black_opts) $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false) @black --check $(black_opts) $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
@ruff $(checkfiles) @ruff $(checkfiles)
check: deps _check
test: deps test: deps
$(py_warn) TEST_DB=sqlite://:memory: py.test $(py_warn) TEST_DB=sqlite://:memory: py.test
@ -34,9 +36,10 @@ test_mysql:
test_postgres: test_postgres:
$(py_warn) TEST_DB="postgres://postgres:$(POSTGRES_PASS)@$(POSTGRES_HOST):$(POSTGRES_PORT)/test_\{\}" pytest -vv -s $(py_warn) TEST_DB="postgres://postgres:$(POSTGRES_PASS)@$(POSTGRES_HOST):$(POSTGRES_PORT)/test_\{\}" pytest -vv -s
testall: deps test_sqlite test_postgres test_mysql _testall: test_sqlite test_postgres test_mysql
testall: deps _test_all
build: deps build: deps
@poetry build @poetry build
ci: check testall ci: check _testall