From cdb8b0987b5916c9116495251337c08d8eb33093 Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Fri, 31 Jan 2025 11:42:12 +0530 Subject: [PATCH 1/3] Cleanup test workflow --- .github/workflows/reusable-test.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml index 42c49ea9e1..b392f3fb00 100644 --- a/.github/workflows/reusable-test.yml +++ b/.github/workflows/reusable-test.yml @@ -47,23 +47,11 @@ jobs: mkdir -p ${{ runner.temp }}/.buildx-cache-new mkdir -p ${{ runner.temp }}/.buildx-mounted-cache - - name: Bake docker images - uses: docker/bake-action@v5 - with: - load: true - pull: true - set: | - *.cache-from=type=local,src=${{ runner.temp }}/.buildx-cache - *.cache-to=type=local,dest=${{ runner.temp }}/.buildx-cache-new,mode=max - files: docker-compose.yaml,docker-compose.local.yaml - env: - DOCKER_BUILD_SUMMARY: false - - name: Build images run: | docker buildx build \ --file docker/dev.Dockerfile \ - --tag care:dev \ + --tag care_local \ --cache-from=type=local,src=${{ runner.temp }}/.buildx-cache \ --cache-to=type=local,dest=${{ runner.temp }}/.buildx-cache-new,mode=max \ --platform linux/arm64 \ From f969463fcc217f579805d5cdd29fa386c10731e0 Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Fri, 31 Jan 2025 12:55:51 +0530 Subject: [PATCH 2/3] Improve caching in lint workflow --- .github/workflows/linter.yml | 28 +++++++++++++++++++++++-- .github/workflows/test-merge-queue.yml | 1 + .github/workflows/test-pull-request.yml | 1 + 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 2d167f9b4c..717b11c65f 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -5,6 +5,10 @@ on: branches: - develop - staging + push: + branches: + - develop + - staging merge_group: jobs: @@ -18,7 +22,27 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.13" + cache: "pip" + + - run: | + python -m pip install pre-commit + python -m pip freeze --local + + - name: Restore pre-commit cache + id: cache-restore + uses: actions/cache/restore@v4 + with: + path: ~/.cache/pre-commit + key: ${{ runner.os }}-${{ runner.arch }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + + - run: | + pre-commit run --show-diff-on-failure --color=always \ + --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }} - - uses: pre-commit/action@v3.0.1 + - name: Save pre-commit cache + id: cache-save + if: ${{ steps.cache-restore.outputs.cache-hit != 'true' && github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/staging') }} + uses: actions/cache/save@v4 with: - extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }} + path: ~/.cache/pre-commit + key: ${{ runner.os }}-${{ runner.arch }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} diff --git a/.github/workflows/test-merge-queue.yml b/.github/workflows/test-merge-queue.yml index 5bc3004158..cae0b5822e 100644 --- a/.github/workflows/test-merge-queue.yml +++ b/.github/workflows/test-merge-queue.yml @@ -5,6 +5,7 @@ on: jobs: test: + name: Test uses: ./.github/workflows/reusable-test.yml secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index 8cb1c851de..b8d57eead7 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -9,6 +9,7 @@ concurrency: jobs: test: + name: Test uses: ./.github/workflows/reusable-test.yml secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 5e20e141d910b7365a52987873c0dfa149cd13db Mon Sep 17 00:00:00 2001 From: Aakash Singh Date: Fri, 31 Jan 2025 13:03:52 +0530 Subject: [PATCH 3/3] Remove caching in lint action --- .github/workflows/linter.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 717b11c65f..f7408a6135 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -5,10 +5,6 @@ on: branches: - develop - staging - push: - branches: - - develop - - staging merge_group: jobs: @@ -22,27 +18,10 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.13" - cache: "pip" - run: | python -m pip install pre-commit - python -m pip freeze --local - - - name: Restore pre-commit cache - id: cache-restore - uses: actions/cache/restore@v4 - with: - path: ~/.cache/pre-commit - key: ${{ runner.os }}-${{ runner.arch }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} - run: | pre-commit run --show-diff-on-failure --color=always \ --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }} - - - name: Save pre-commit cache - id: cache-save - if: ${{ steps.cache-restore.outputs.cache-hit != 'true' && github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/staging') }} - uses: actions/cache/save@v4 - with: - path: ~/.cache/pre-commit - key: ${{ runner.os }}-${{ runner.arch }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}