-
-
Notifications
You must be signed in to change notification settings - Fork 87
139 lines (114 loc) · 3.78 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
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
---
name: OpenWisp WiFi Login Pages CI BUILD
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
qa-checks:
name: QA-Checks
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "**/requirements*.txt"
- name: Installing dependencies
run: |
yarn install
pip install -r requirements-qa.txt
- name: QA checks
run: ./run-qa-checks
build:
name: Tests and Coverage
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache yarn
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Installing dependencies
run: |
yarn install
yarn setup
sudo apt update -qq
sudo apt install -qq -y libssl-dev libffi-dev
- name: Tests
run: yarn coverage
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "**/requirements*.txt"
- name: Get openwisp-radius
run: |
curl -L https://github.com/openwisp/openwisp-radius/tarball/master \
-o openwisp-radius.tar.gz
tar -xvzf openwisp-radius.tar.gz && mkdir openwisp-radius
mv openwisp-*/* openwisp-radius
- name: Cache python environment
uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{secrets.CACHE_VERSION}}-${{ hashFiles('openwisp-radius/setup.py') }}
- name: Installing OpenWISP Radius
run: |
cd openwisp-radius
pip install -U pip setuptools wheel
pip install -U -e ".[saml]"
pip install -U -r requirements-test.txt
pip install -U "Django~=4.2.15"
./tests/manage.py migrate
- name: Creating configuration of organization (supports mobile verification)
run: node browser-test/create-mobile-configuration.js
- name: Build OpenWISP WiFi Login Pages
run: yarn build-dev
- name: Running OpenWISP WiFi Login Pages
run: yarn start &
- name: Running OpenWISP Radius
run: |
cp browser-test/local_settings.py \
openwisp-radius/tests/openwisp2/local_settings.py
cd openwisp-radius
./tests/manage.py runserver &
- name: geckodriver/firefox
run: |
echo "geckodriver/firefox"
which geckodriver
geckodriver --version
which firefox
firefox --version
- name: Browser Tests
run: |
export OPENWISP_RADIUS_PATH=$(pwd)/openwisp-radius
yarn browser-test
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}