diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 792a770..8095484 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,11 +23,27 @@ jobs: with: python-version: "3.10" + - name: Cache pip dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + # key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip- + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies run: | python -m pip install pre-commit pre-commit install + - name: Cache shfmt binary + uses: actions/cache@v3 + with: + path: /usr/local/bin/shfmt + # key: ${{ runner.os }}-shfmt-${{ env.SHFMT_VERSION }} + key: ${{ runner.os }}-shfmt- + - name: Install shfmt run: | SHFMT_VERSION="v3.7.0" @@ -39,7 +55,10 @@ jobs: - name: Run pre-commits run: | # pre-commit run --all-files - pre-commit run --from-ref ${{ env.BASE_COMMIT_ID }} --to-ref $(git log --pretty=tformat:"%H" -n1 .) + CUR_SHA=$(git log --pretty=tformat:"%H" -n1 .) + echo $CUR_SHA + echo ${{ env.BASE_COMMIT_ID }} + pre-commit run --from-ref ${{ env.BASE_COMMIT_ID }} --to-ref $CUR_SHA # pre-commit run --from-ref origin/main --to-ref HEAD # run: | # BASE_COMMIT_ID=$(git rev-parse origin/main)