-
-
Notifications
You must be signed in to change notification settings - Fork 13
71 lines (59 loc) · 1.92 KB
/
test.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
name: CI
on:
push:
branches:
- master
pull_request:
branches_ignore: []
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup black environment
run: conda create --quiet --name black pyflakes
- name: Check formatting with black
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate black
pip install black
black --check urlchecker
type_checking:
needs: formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup mypy environment
run: conda create --quiet --name type_checking mypy
- name: Check types with mypy
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate type_checking
pip install mypy
pip install types-requests
mypy urlchecker
testing:
needs: type_checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup testing environment
run: conda create --quiet --name testing pytest
- name: Download ChromeDriver
run: |
# Note if you use locally, must match
wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/121.0.6167.85/linux64/chromedriver-linux64.zip
unzip chromedriver-linux64.zip
rm chromedriver-linux64.zip
- name: Test
run: |
export PATH="/usr/share/miniconda/bin:$PATH"
source activate testing
pip install .[all]
pip install -r tests/test-requirements.txt
pytest -vs -x --cov=./urlchecker tests/test_*.py
- name: Test Building container image
run: |
docker build -t quay.io/urlstechie/urlchecker .
DOCKER_TAG=$(docker run quay.io/urlstechie/urlchecker --version)
printf "Docker Tag is ${DOCKER_TAG}\n"