-
Notifications
You must be signed in to change notification settings - Fork 530
97 lines (75 loc) · 2.23 KB
/
codebase-test.yaml
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: Software test, formatting & publishing
on:
push:
paths:
- 'src/lavague/**.py'
- '.github/setup-driver.sh'
- 'examples/configurations/**'
- 'examples/instructions/**'
jobs:
lint:
name: Run Ruff Linter
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Ruff
run: pip install ruff
- name: Run Ruff on src/lavague
run: ruff format src/lavague/
- name: Run Ruff on examples
run: ruff format examples/
test:
name: Run Installation and Tests
runs-on: ubuntu-latest
needs: lint
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install necessary dependencies
run: |
bash setup.sh
pip install -e '.[playwright]'
playwright install chromium
- name: Run selenium test
run: lavague -c examples/test-configurations/test_selenium.py -i examples/instructions/hackernews.yaml test
- name: Run playwright test
run: lavague -c examples/test-configurations/test_playwright.py -i examples/instructions/hackernews.yaml test
- name: Execute Generated Python Scripts
run: python hackernews_test_selenium_gen.py && python hackernews_test_playwright_gen.py
- name: Check Execution Status
if: ${{ failure() }}
run: echo "Script execution failed" && exit 1
publish:
name: Push on PyPI
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install twine & build
run: >-
python3 -m
pip install
twine build
--user
- name: Build the wheel and the source tarball
run: python3 -m build
- name: Publish to github
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: twine upload dist/*