-
-
Notifications
You must be signed in to change notification settings - Fork 6
72 lines (69 loc) · 2.08 KB
/
test-providers.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
---
name: Test providers
on: # yamllint disable-line rule:truthy
pull_request:
paths:
- .github/workflows/test-providers.yml
- dist/**
- src/**
- action.yml
push:
branches:
- main
defaults:
run:
shell: sh
jobs:
test-providers:
name: ${{ matrix.provider }}
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- provider: "deepl"
lang: "en-uk"
source: "Love"
expected: "Любов"
api_key: "DEEPL_API_KEY" # pragma: allowlist secret
- provider: "google"
lang: "en-hr"
source: "Love"
expected: "Ljubav"
api_key: "N_A" # pragma: allowlist secret
- provider: "linguatools"
lang: "en-de"
source: "Love"
expected: "Love"
api_key: "N_A" # pragma: allowlist secret
- provider: "mymemory"
lang: "en|sw"
source: "Love"
expected: "Upendo"
api_key: "N_A" # pragma: allowlist secret
- provider: "mymemory"
lang: "en|pt"
source: "Love"
expected: "Amor"
api_key: "MYMEMORY_API_KEY" # pragma: allowlist secret
- provider: "funtranslations"
lang: "klingon"
source: "Love"
expected: "Parmaq"
api_key: "N_A" # pragma: allowlist secret
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
- name: Translate (${{ matrix.provider }}, ${{ matrix.lang }})
uses: ./
id: result
with:
provider: ${{ matrix.provider }}
lang: ${{ matrix.lang }}
source: ${{ matrix.source }}
api_key: "${{ secrets[matrix.api_key] }}"
- name: Validate ${{ matrix.provider }} translation result
run: |
echo "'${{ matrix.source }}' has been translated to '${{ steps.result.outputs.text }}'"
[ "${{ steps.result.outputs.text }}" = "${{ matrix.expected }}" ] || exit 1;