From 79a6d3a20892437f10610957acd49dff2887ec4f Mon Sep 17 00:00:00 2001 From: phi Date: Sat, 2 Mar 2024 03:41:23 +0900 Subject: [PATCH] fix: test --- .github/workflows/check.yaml | 56 +++++++++++++++++------------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index c802ef4..559d3be 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8"] #, "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -27,33 +27,29 @@ jobs: VERSION=$(cat .python-version) echo "python_version=${VERSION}" >> $GITHUB_OUTPUT - - name: echo output + - name: Load cached venv + id: cached-venv-dependencies + uses: actions/cache@v4 + with: + path: .venv + key: venv-${{ runner.os }}-${{ steps.set-python.outputs.python_version }}-${{ hashFiles('**/pyproject.toml') }} + + - name: Install dependencies + if: steps.cached-venv-dependencies.outputs.cache-hit != 'true' + run: | + rye sync --all-features + + - name: Load cached pre-commit + id: cached-pre-commit-dependencies + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: venv-${{ runner.os }}-${{ steps.cached-venv-dependencies.outputs.python_version }}-${{ hashFiles('**/pyproject.toml') }} + + - name: Code checks + run: | + rye run pre-commit run --all-files --show-diff-on-failure + + - name: Test with pytest run: | - echo ${{ steps.set-python.outputs.python_version }} - - # - name: Load cached venv - # id: cached-venv-dependencies - # uses: actions/cache@v4 - # with: - # path: .venv - # key: venv-${{ runner.os }}-${{ steps.cached-venv-dependencies.outputs.python_version }}-${{ hashFiles('**/pyproject.toml') }} - - # - name: Install dependencies - # if: steps.cached-venv-dependencies.outputs.cache-hit != 'true' - # run: | - # rye sync --all-features - - # - name: Load cached pre-commit - # id: cached-pre-commit-dependencies - # uses: actions/cache@v4 - # with: - # path: ~/.cache/pre-commit - # key: venv-${{ runner.os }}-${{ steps.cached-venv-dependencies.outputs.python_version }}-${{ hashFiles('**/pyproject.toml') }} - - # - name: Code checks - # run: | - # rye run pre-commit run --all-files --show-diff-on-failure - - # - name: Test with pytest - # run: | - # rye run pytest \ No newline at end of file + rye run pytest \ No newline at end of file