-
Notifications
You must be signed in to change notification settings - Fork 302
61 lines (54 loc) · 1.79 KB
/
unittests.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# If you change this name, don't forget to change deploy-to-alpha.yml
name: Unit tests
on:
push:
pull_request:
workflow_dispatch: {} # Allow running the workflow on-demand
jobs:
# This identifier gets used in .mergify.yml
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
cache: 'pip'
- name: Set up NodeJS 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
- name: Install Nodejs dependencies
run: |
npm ci
- name: Prepare backend
run: |
doit run backend
# This code is also in 'update-javascript-on-main'
- name: Calculate hedy cache key
run: "echo value=$(ls -1 hedy.py grammars/* | sort | xargs tail -n 99999999 | sha256sum | cut -f 1 -d ' ') >> $GITHUB_OUTPUT"
id: hedy_cache_key
- name: Cache hedy test runs
uses: actions/cache@v3
with:
path: .test-cache
key: "hedy-test-cache-${{ steps.hedy_cache_key.outputs.value }}"
- name: Run weblate tests
shell: pwsh
id: weblate_tests
if: github.event.pull_request.user.login == 'weblate'
run: |
build-tools/github/validate --weblate
- name: Run all tests
shell: pwsh
if: github.event.pull_request.user.login != 'weblate'
run: |
build-tools/github/validate