Repository navigation
61 lines (61 loc) · 1.79 KB
/
Copy pathtest-cli.yml
File metadata and controls
61 lines (61 loc) · 1.79 KB
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
# Currently this does not contain any tests, only a license check
# Once we add tests, we should add a step here to run them
name: Run CLI Tests
on:
pull_request:
paths:
- 'paths/**'
- 'paths.yaml'
- 'schemas/**'
- 'schemas.yaml'
- 'parameters.yaml'
- 'responses.yaml'
- 'headers.yaml'
- 'main.yaml'
- 'openapi-generator/templates/cli/**'
- openapi-generator/cli_lang.yaml
- 'clients/cli/**'
- .github/workflows/test-cli.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.27.1'
- name: Generate CLI
env:
GOPRIVATE: github.com/phrase/phrase-go
run: |
{
npm install
npm run generate.go
cd ./clients/cli
go mod edit -replace github.com/phrase/phrase-go/v4=../go
npm run generate.cli
} > generate.log 2>&1 || { cat generate.log; exit 1; }
- name: Build and run unit tests
run: |
cd ./clients/cli
go build .
go test -v ./...
- name: Install Ruby and rspec
uses: ruby/setup-ruby@354a1ad156761f5ee2b7b13fa8e09943a5e8d252
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: ./clients/cli
- name: Run integration tests
run: |
cd ./clients/cli
bundle exec rspec --format documentation
- name: License check
uses: phrase/actions/lawa-ci@v1
with:
github-token: ${{ secrets.GH_LAWA_ACCESS_TOKEN }}
decisions-file: .license-decisions.yml
working-directory: clients/cli
package-managers: gomodules