forked from openedx-unsupported/edx-analytics-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (95 loc) · 3.29 KB
/
ci.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
name: Default CI
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.12"]
os: [ubuntu-20.04]
toxenv: [django42]
env:
DATA_API_VERSION: "latest"
steps:
- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Format Python Version
id: format_python_version
shell: bash
run: |
# Replace the dot in the Python version and remove 'py'
FORMATTED_VERSION=${{ matrix.python-version }} # e.g., 3.12
FORMATTED_VERSION=${FORMATTED_VERSION//./} # becomes 312
# Set environment variables
echo "FORMATTED_PYTHON_VERSION=py${FORMATTED_VERSION}" >> $GITHUB_ENV
# Output formatted version for use in subsequent steps
echo "Formatted Python Version: py${FORMATTED_VERSION}"
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: start container
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: docker compose -f .github/docker-compose-github.yml up -d
- name: setup analytics-api
run: |
docker exec analytics_api bash -c "
source /edx/app/analytics_api/venvs/analytics_api/bin/activate &&
pip install setuptools==68.2.2 &&
make -C /edx/app/analytics_api/analytics_api github_ci"
- name: install dependencies
run: pip install -r requirements/github.txt
- name: test quality
run: ./.github/scripts/testing.sh
shell: bash
env:
TESTNAME: quality
TARGETS: "quality"
TOXENV: ${{ env.FORMATTED_PYTHON_VERSION }}-${{ matrix.toxenv }}
- name: test js
run: ./.github/scripts/testing-js.sh
shell: bash
env:
TESTNAME: js
NODE: ${{ matrix.node }}
TOXENV: ${{ env.FORMATTED_PYTHON_VERSION }}-${{ matrix.toxenv }}
TARGETS: "requirements.js validate_js"
- name: test i18n
run: ./.github/scripts/testing.sh
shell: bash
env:
TESTNAME: test-i18n
TOXENV: ${{ env.FORMATTED_PYTHON_VERSION }}-${{ matrix.toxenv }}
TARGETS: "generate_fake_translations"
- name: test acceptance
run: ./.github/scripts/testing-js.sh
shell: bash
env:
TESTNAME: acceptance
NODE: ${{ matrix.node }}
TOXENV: ${{ env.FORMATTED_PYTHON_VERSION }}-${{ matrix.toxenv }}
TARGETS: "requirements.a11y migrate requirements.js static accept"
- name: test python
run: ./.github/scripts/testing-js.sh
shell: bash
env:
TESTNAME: test-python
NODE: ${{ matrix.node }}
TOXENV: ${{ env.FORMATTED_PYTHON_VERSION }}-${{ matrix.toxenv }}
TARGETS: "requirements.js static test_python"
- name: Run coverage
if: matrix.python-version == '3.12' && matrix.toxenv == 'django42'
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
MINIMUM_GREEN: 95
MINIMUM_ORANGE: 84
ANNOTATE_MISSING_LINES: true
ANNOTATION_TYPE: error