[CI] Improve Docker image caching by copying app code last (#36) #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Busted test suite | |
| on: [push, pull_request] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: false | |
| load: true | |
| tags: | | |
| koreader/kosync:test | |
| koreader/kosync:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Run busted test suite | |
| run: make test VERSION=test | |
| - name: Verify production healthcheck | |
| run: | | |
| docker run -d --name kosync-test koreader/kosync:test | |
| sleep 5 | |
| docker exec kosync-test /app/koreader-sync-server/scripts/healthcheck.sh |