Skip to content

Fixup some database problems #204

Fixup some database problems

Fixup some database problems #204

Workflow file for this run

name: simple-kbs mysql tests
on:
push:
branches: [ main, staging ]
pull_request:
branches: [ main, staging ]
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: cargo check
uses: actions-rs/cargo@v1
with:
command: check
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: cargo format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings -A clippy::derive_partial_eq_without_eq
test:
runs-on: ubuntu-latest
env:
KBS_DB_HOST: localhost
KBS_DB_USER: root
KBS_DB_PW: root
KBS_DB: simple_kbs
KBS_DB_TYPE: mysql
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: setup mysql
run: |
sudo systemctl start mysql
mysql -u${{env.KBS_DB_USER}} -p${{env.KBS_DB_PW}} -e 'CREATE DATABASE ${{env.KBS_DB}};'
mysql -u${{env.KBS_DB_USER}} -p${{env.KBS_DB_PW}} ${{env.KBS_DB}} < db/db-mysql.sql
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test