This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (57 loc) · 1.88 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
name: test pytransifex
concurrency: testing_environment
on:
pull_request:
branches:
- master
push:
branches:
- master
workflow_dispatch:
workflow_call:
jobs:
tests:
runs-on: ubuntu-latest
steps:
# Not using strategy.matrix to create multiple jobs
# as we do NOT want to test with any form of concurrency
# to avoid 'race conditions' against Transifex
- name: Check out repository code
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "requirements/*.txt"
- name: Install project requirements
run: |
python -m pip install -U -r requirements/base.txt
python -m pip install -U -r requirements/dev.txt
- name: Test API
env:
organization: ${{ secrets.ORGANIZATION }}
tx_token: ${{ secrets.TX_TOKEN }}
run: |
TX_TOKEN=$tx_token ORGANIZATION=$organization \
python -m unittest ./tests/test_api.py
- name: Test CLI
env:
organization: ${{ secrets.ORGANIZATION }}
tx_token: ${{ secrets.TX_TOKEN }}
run: |
TX_TOKEN=$tx_token ORGANIZATION=$organization \
python -m unittest ./tests/test_cli.py
- name: Test with a public project
env:
organization: ${{ secrets.ORGANIZATION }}
tx_token: ${{ secrets.TX_TOKEN }}
run: |
TX_TOKEN=$tx_token ORGANIZATION=$organization \
python -m unittest ./tests/test_public_project.py
- name: Test with Qgisplugin's 'test_translation'
env:
organization: ${{ secrets.ORGANIZATION }}
tx_token: ${{ secrets.TX_TOKEN }}
run: |
TX_TOKEN=$tx_token ORGANIZATION=$organization \
python -m unittest ./tests/test_translation.py