-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (63 loc) · 1.88 KB
/
build-ros-docker.yaml
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
name: docker image build
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
paths-ignore:
- "docs/**"
- "**.md"
push:
# only build when after merging
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install dependencies
run: |
sudo apt-get install portaudio19-dev
echo "Current directory $PWD"; curl -sSL https://install.python-poetry.org/ | python -
poetry install ; pip install -e .
python3 -m pip install types-pytz
python3 -m pip install types-requests
- name: Install pytest
run: |
pip install pytest
- name: Run tests
run: |
poetry run pytest tests
- name: Install lint dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 mypy==1.1.1 isort black
- name: Run black
run: |
black --check .
- name: Run Flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run mypy
run: |
mypy . --exclude '(mnlm/tests/*|examples/*)'
- name: Run isort
run: |
isort --check --diff .
build:
# Only build when after merging
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ros-m1:$(date +%s)