-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (68 loc) · 1.93 KB
/
go-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
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Verify code formatting
run: |
go install mvdan.cc/[email protected]
test -z $(gofumpt -l .)
- name: Run linter
if: always()
run: |
go install honnef.co/go/tools/cmd/[email protected]
staticcheck ./...
- name: Run tests with coverage
if: always()
run: go test -cover ./...
integration-test:
name: Integration test with Flutter ${{ matrix.flutter_version }}
runs-on: ubuntu-latest
strategy:
matrix:
flutter_version: ['3.16']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Build binary
run: |
go build
mv ./poe2arb /usr/local/bin
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '${{ matrix.flutter_version }}'
- name: Run integration test
env:
# Read-only POEditor token for albert+poe2arb@...
POEDITOR_TOKEN: ${{ secrets.POEDITOR_INTEGRATION_TESTS_TOKEN }}
working-directory: integration_test
run: |
poe2arb poe
poe2arb poe --output-dir lib/l10n_prefixed --term-prefix prefixed
flutter gen-l10n
- name: Print ARBs
working-directory: integration_test
run: |
for dir in l10n l10n_prefixed; do
for locale in en pl en_hk sr sr_cyrl es es_419; do
echo "=== lib/$dir/app_$locale.arb ==="
cat lib/$dir/app_$locale.arb
done
done