upgrade docker action, yew and actix sqlx #16
Workflow file for this run
This file contains 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
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md | |
on: | |
pull_request: | |
paths: | |
- 'actix-api/**' | |
- 'types/**' | |
- 'yew-ui/**' | |
- 'docker/**' | |
name: check backend | |
jobs: | |
test: | |
name: cargo test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Cache Docker layers | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.docker | |
key: ${{ runner.os }}-docker-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-docker- | |
# Cache Rust build artifacts | |
- name: Cache Cargo Registry | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
# Load cached Docker images | |
- name: Load cached Docker images | |
run: | | |
mkdir -p /tmp/.docker | |
if [ -d "/tmp/.docker" ]; then | |
docker load < /tmp/.docker/images.tar || true | |
fi | |
- run: make check | |
- run: make test | |
# Save Docker images after tests | |
- name: Save Docker images | |
run: | | |
mkdir -p /tmp/.docker | |
docker save -o /tmp/.docker/images.tar $(docker-compose -f docker/docker-compose.yaml config --services | awk '{print $1}') |