-
Notifications
You must be signed in to change notification settings - Fork 14
141 lines (121 loc) · 4.13 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
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
name: Test
on:
schedule:
- cron: '0 * * * *'
pull_request:
push:
branches:
- '[0-9].[0-9].x'
tags:
- '*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: 'Python 3.12'
os: ubuntu-latest
python: '3.12'
- name: 'Python 3.11'
os: ubuntu-latest
python: '3.11'
- name: 'macOS'
os: macos-latest
python: '3.12'
- name: 'Windows'
os: windows-latest
python: '3.12'
steps:
- name: Check out the source code
uses: actions/checkout@v4
- name: Get the pip cache directory
run: echo "pip_cache_dir=$(pip cache dir)" >> $GITHUB_ENV
shell: bash
- name: Cache pip
uses: actions/cache@v4
with:
path: ${{ env.pip_cache_dir }}
key: pip-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('./setup.py') }}
restore-keys: |
pip-${{ runner.os }}-${{ matrix.python }}-
- name: Get the npm cache directory
run: echo "npm_cache_dir=$(npm config get cache)" >> $GITHUB_ENV
shell: bash
- name: Cache npm
uses: actions/cache@v4
with:
path: ${{ env.npm_cache_dir }}
key: npm-${{ runner.os }}-${{ hashFiles('./package.json') }}
restore-keys: |
npm-${{ runner.os }}-
- name: Cache Mypy
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v4
with:
path: ./.mypy_cache
key: mypy-${{ matrix.python }}-${{ hashFiles('./setup.py') }}
restore-keys: |
mypy-${{ matrix.python }}-
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Install APT dependencies
if: startsWith(runner.os, 'Linux')
run: |
sudo apt-get update
apt_packages=(
libasound2 # For Cypress
libegl1-mesa # For Qt
libgbm-dev # For Cypress
libgconf-2-4 # For Cypress
libgtk2.0-0 # For Cypress
libgtk-3-0 # For Cypress
libnotify-dev # For Cypress
libnss3 # For Cypress
libx11-xcb-dev # For Qt
'^libxcb.*-dev' # For Qt
libxkbcommon-x11-0 # For Qt
libxss1 # For Cypress
libxtst6 # For Cypress
xauth # For Cypress
xvfb # For Cypress and pytest-xvfb
)
sudo apt-get install "${apt_packages[@]}"
- name: Instlal Lua
if: startsWith(runner.os, 'Linux')
uses: leafo/gh-actions-lua@v10
- name: Install LuaRocks
if: startsWith(runner.os, 'Linux')
uses: leafo/gh-actions-luarocks@v4
- name: Install Lua dependencies
if: startsWith(runner.os, 'Linux')
run: luarocks install busted
- name: Build the development environment
run: ./bin/build-ci
shell: bash
- name: Get the Cypress cache directory
if: startsWith(runner.os, 'Linux')
run: echo "cypress_cache_dir=$(./node_modules/.bin/cypress cache path)" >> $GITHUB_ENV
shell: bash
- name: Cache Cypress
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v4
with:
path: ${{ env.cypress_cache_dir }}
key: cypress-${{ runner.os }}-${{ hashFiles('./package.json') }}
restore-keys: |
cypress-
- name: Run the tests
if: startsWith(runner.os, 'Linux')
run: BETTY_TEST_SKIP_PYINSTALLER=true ./bin/test
shell: bash
- name: Run the tests
if: ${{ ! startsWith(runner.os, 'Linux') }}
run: BETTY_TEST_SKIP_SHELLCHECK=true BETTY_TEST_SKIP_FLAKE8=true BETTY_TEST_SKIP_MYPY=true BETTY_TEST_SKIP_STYLELINT=true BETTY_TEST_SKIP_ESLINT=true BETTY_TEST_SKIP_BUSTED=true BETTY_TEST_SKIP_CYPRESS=true BETTY_TEST_SKIP_PYINSTALLER=true ./bin/test
shell: bash
- name: Upload code coverage
uses: codecov/codecov-action@v4