diff --git a/.github/workflows/pull_request.yml b/.github/workflows/ci.yml similarity index 53% rename from .github/workflows/pull_request.yml rename to .github/workflows/ci.yml index c8a28a320..a1be94137 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,12 @@ name: Lint and Test -on: pull_request +on: + pull_request: + push: + branches: + - main jobs: - static-checks: runs-on: ubuntu-latest steps: @@ -22,17 +25,34 @@ jobs: steps: - uses: actions/checkout@v4 - uses: extractions/setup-just@v3 + + # Set up Docker Buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # Cache Docker layers + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + # Use a hash of any files that affect the Docker build context + key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile', 'docker-compose*.yml', 'poetry.lock', 'pyproject.toml') }} + # Fallback to a more generic key if the specific one is not found + restore-keys: | + ${{ runner.os }}-buildx- + - name: Run tests run: | just build just up just test + - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: name: playwright-traces path: build/test-results/ - - if: ${{ failure() }} + - if: ${{ failure() && github.event_name == 'pull_request' }} name: Print logs run: | FOLLOW_LOGS='' just logs