update rustfmt #58
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
name: ci | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
whatsoo: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: ["mysql:8.0.18"] | |
services: | |
mysql: | |
image: ${{ matrix.image }} | |
env: | |
MYSQL_ROOT_PASSWORD: 123456 | |
MYSQL_DATABASE: whatsoo | |
ports: | |
# will assign a random free host port | |
- 3306/tcp | |
# needed because the container does not provide a healthcheck | |
options: >- | |
--health-cmd "mysqladmin ping --silent" --health-interval 30s --health-timeout 30s | |
--health-retries 10 -v /data/mysql:/var/lib/mysql | |
steps: | |
- uses: actions/checkout@v1 | |
# Rust ------------------------------------------------ | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
- name: Cache target/ | |
uses: actions/cache@v1 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
- name: Load schema | |
working-directory: ./ | |
run: | | |
export CONTAINER_ID=$(docker ps --filter "ancestor=${{ matrix.image }}" --format "{{.ID}}") | |
docker cp schema.sql $CONTAINER_ID:/schema.sql | |
docker exec $CONTAINER_ID bash -c "mysql -uroot -p123456 whatsoo < /schema.sql" | |
- working-directory: ./ | |
run: cargo build | |
env: | |
DATABASE_URL: mysql://root:123456@localhost:${{ job.services.mysql.ports[3306] }}/whatsoo |