-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (84 loc) · 2.5 KB
/
check.yml
File metadata and controls
86 lines (84 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Code formatting, semantic checking and tests
on:
push:
branches:
- main
pull_request:
branches:
- main
pull_request_review:
types:
- submitted
jobs:
rust-check:
name: Checks for Rust
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache for cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust toolchain
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: Check formatting
run: cargo fmt --check
working-directory: flowmium
- name: Start test services
run: docker compose -f test-services.yaml up -d
working-directory: flowmium
- name: Wait for test services to be healthy
timeout-minutes: 5
run: |
for cid in $(docker ps -a -q); do
while [ "`docker inspect -f {{.State.Status}} $cid`" != "running" ]; do
sleep 2;
done
done
- name: Install sqlx CLI
run: cargo install sqlx-cli
working-directory: flowmium
- name: Run migrations on test database
run: sqlx migrate run
working-directory: flowmium
- name: Run clippy
run: cargo clippy
working-directory: flowmium
- name: Run tests
run: FLOWMIUM_INIT_CONTAINER_IMAGE_FROM_SOURCE=true make test
working-directory: flowmium
python-check:
name: Checks for Python
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install poetry
run: pip install poetry
working-directory: framework
- name: Install dependencies
run: poetry install
working-directory: framework
- name: Check formatting
run: poetry run black . --check
working-directory: framework
- name: Run flake8
run: poetry run flake8 flowmium tests
working-directory: framework
- name: Run mypy
run: poetry run mypy flowmium tests
working-directory: framework
- name: Run pytest
run: poetry run pytest
working-directory: framework