-
Notifications
You must be signed in to change notification settings - Fork 1
152 lines (121 loc) · 4.45 KB
/
wf.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
---
name: Fitness Tracker Workflow
on:
workflow_dispatch:
push:
branches:
- main
jobs:
qualify_code:
runs-on: ubuntu-20.04 # ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: pip
- name: Install and cache poetry
run: make -f .config/Makefile install-poetry
if: steps.cache.outputs.cache-hit != 'true'
- name: Cache poetry dependencies
id: cache
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-poetry-
- name: Install dependencies with poetry
run: poetry install
env:
POETRY_VIRTUALENVS_IN_PROJECT: true
if: steps.cache.outputs.cache-hit != 'true'
- name: Cache mypy dependencies
uses: actions/cache@v4
with:
path: ~/.cache/mypy
key: ${{ runner.os }}-mypy-${{ hashFiles('**/mypy.ini') }}
restore-keys: ${{ runner.os }}-mypy-
- name: Check poetry version
run: poetry --version
# - name: Format with Ruff
# run: poetry ruff format .
- name: Lint with ruff
run: make -f .config/Makefile lint-ruff
- name: Static type checks with mypy
run: make -f .config/Makefile static-type-checks
- name: wily build and rank
run: make -f .config/Makefile wily-build-and-rank
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
- name: yamllint workout_programs
uses: ibiqlik/action-yamllint@v3
with:
file_or_dir: "./docs/project_docs/Workout-Programs/workout_programs.yml"
- name: Check working directory
run: pwd
# - name: Set up working directory
# run: cd /home/runner/work/fitness-tracker/fitness-tracker
# - name: Set PYTHONPATH
# run: echo "PYTHONPATH=/home/runner/work/fitness-tracker/fitness-tracker" >> $GITHUB_ENV
- name: Set working directory
run: |
cd /home/runner/work/fitness-tracker/fitness-tracker
echo "PYTHONPATH=$PYTHONPATH:/home/runner/work/fitness-tracker/fitness-tracker" >> $GITHUB_ENV
# - name: Run pytest
# run: poetry run pytest --durations=10 test/test_model.py
# - name: BDD with Behave
# run: poetry run behave
# - name: Generate coverage report
# run: |
# poetry run pytest --cov=./ --cov-report=xml
# - name: Check folders
# run: |
# pwd
# ls
# ls -ll docs
# ls -ll docs/project_docs
# ls -ll docs/project_docs/workout-programs
- name: run tests and generate coverage
run: make -f .config/Makefile run-tests-and-coverage
env:
EMAIL: ${{ secrets.EMAIL }}
USER: ${{ secrets.USER }}
- uses: codecov/codecov-action@v4
with:
# name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true # optional (default = false)
codecov_yml_path: .config/codecov.yml
- uses: rojopolis/[email protected]
name: Spellcheck
with:
config_path: .config/.spellcheck.yml
source_files: README.md # workout_programs.md
task_name: Markdown
# - name: Pydantic data validation
# run: poetry run python src/helpers/validate.py
# deploy_to_AWS_ECR:
# needs: qualify_code
# runs-on: ubuntu-latest
# steps:
# - name: Check out repository code
# uses: actions/checkout@v4
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: eu-central-1
# - name: Login to AWS ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v2
# - name: Build, tag, and push image to Amazon ECR
# env:
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# ECR_REPOSITORY: fitness-tracker
# IMAGE_TAG: ft-image
# run: |
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
# docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG