From a066ba06d05474b054a2c47ddfee09f4a9b3c57f Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 17 Jan 2024 15:41:11 +0800 Subject: feat(ci|test): enhance test and test commit --- .github/workflows/test.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/test.yml (limited to '.github/workflows') diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..8d90f73 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +on: + push: + workflow_dispatch: + +jobs: + test-api: + name: test commit + runs-on: ubuntu-latest + permissions: + id-token: write + contents: write + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - run: | + pwd + cd tests + python3 -m test-api.py \ No newline at end of file -- cgit v1.2.3-70-g09d2 From bf445b19e830acce98d6e57068df43dcee5fbd2d Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 17 Jan 2024 16:29:09 +0800 Subject: chore(ci): add section --- .github/workflows/test.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d90f73..f1648eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,14 @@ jobs: with: python-version: "3.9" - - run: | - pwd - cd tests - python3 -m test-api.py \ No newline at end of file + - name: set up pdm + run: pip install pdm + + - name: install test deps + run: | + pdm install -dG test + + - name: test api + run: | + cd test + python -m test-api.py \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 81a4d9fa63c4378e0afee4d9f8d1bef9528736f5 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 17 Jan 2024 16:30:22 +0800 Subject: fix(ci): test -> tests --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f1648eb..f4c789f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,5 +26,5 @@ jobs: - name: test api run: | - cd test + cd tests python -m test-api.py \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 7d496726ad6b8ebcd7fa0aa6453f6abf5b97669e Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 17 Jan 2024 16:32:28 +0800 Subject: chore(ci): add pip install --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4c789f..f816148 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,12 +17,13 @@ jobs: with: python-version: "3.9" - - name: set up pdm + - name: setup pdm run: pip install pdm - name: install test deps run: | pdm install -dG test + pip install pytest - name: test api run: | -- cgit v1.2.3-70-g09d2 From 89029672d27d7150fde35d2df50b316aeee31d89 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 17 Jan 2024 16:33:54 +0800 Subject: fix(ci): install self --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f816148..07ae015 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,8 @@ jobs: - name: setup pdm run: pip install pdm + + - run: pdm install - name: install test deps run: | -- cgit v1.2.3-70-g09d2 From c91e570d4f28eeb0a352f5f27b9611377b66da1c Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Wed, 17 Jan 2024 16:36:45 +0800 Subject: --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07ae015..0a6958f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,9 +25,10 @@ jobs: - name: install test deps run: | pdm install -dG test - pip install pytest + # pip install pytest - name: test api run: | cd tests - python -m test-api.py \ No newline at end of file + pdm venv activate in-project + pdm run test-api.py \ No newline at end of file -- cgit v1.2.3-70-g09d2