-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (80 loc) · 2.34 KB
/
main.yml
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
87
88
89
90
91
92
93
94
95
96
97
name: Build & Test
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-interaction
- name: Run pre-commit
run: poetry run pre-commit run -a --show-diff-on-failure
- name: Check Poetry lock file consistency
run: poetry lock --check
build-service:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
service: ["cluster_data", "ingest_reddit", "ingest_tweets", "store_data", "tsf_data"]
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies with pip
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install -r ./all_services/${{ matrix.service }}/requirements.txt
python -m pip install pytest
- name: Test with pytest
working-directory: ./all_services/${{ matrix.service }}
run: pytest
build-poetry:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10"]
defaults:
run:
shell: bash
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install Poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-interaction
- name: Test with pytest
run: poetry run pytest