This repository has been archived by the owner on Sep 18, 2023. It is now read-only.
build: add pre-commit hooks (#73) #222
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: TESTS | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- reopened | |
- synchronize | |
jobs: | |
backend: | |
runs-on: ubuntu-latest | |
container: | |
image: rust:1.68.0 | |
services: | |
mongo: | |
image: mongo:5.0.15 | |
env: | |
MONGO_INITDB_ROOT_USERNAME: root | |
MONGO_INITDB_ROOT_PASSWORD: harbor | |
options: >- | |
--health-cmd "echo 'db.getMongo()' | mongo --norc --quiet --host=localhost:27017" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: CHECKOUT | |
uses: actions/checkout@v3 | |
- name: CACHE | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | |
- name: INSTALL - dependencies | |
run: cargo fetch | |
- name: LINT | |
run: cargo clippy -- -Dwarnings | |
- name: TEST - unit & integration | |
run: cargo test | |
frontend: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ui | |
steps: | |
- name: CHECKOUT | |
uses: actions/checkout@v3 | |
- name: INSTALL- nodejs, yarn | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 19 | |
cache: 'yarn' | |
cache-dependency-path: 'ui/yarn.lock' | |
- name: DEBUG - node, npm, yarn versions | |
run: | | |
echo "node --version: $(node --version)" | |
echo "npm --version: $(npm --version)" | |
echo "yarn --version: $(yarn --version)" | |
- name: INSTALL - ui dependencies | |
working-directory: ui | |
run: CI=true yarn install | |
- name: LINT | |
run: yarn lint | |
- name: TEST - unit | |
run: yarn test |