-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (52 loc) · 1.85 KB
/
ci.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
#(C) Copyright 2022-2023 Hewlett Packard Enterprise Development LP
name: ci
on: [push]
jobs:
ci:
runs-on: ubuntu-20.04
steps:
- name: Checkout workspace
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 16.13.2
- name: Install OpenAPI Generator
run: npm install @openapitools/[email protected] -g
- name: Validate OpenAPI Spec file
run: (cd v1 && make validate)
- name: Generate Client and Interfaces
run: (cd v1 && make gen)
- name: Verifying whether the generated files are checked-in
run: (cd v1 && make verify_gen)
- name: Verifying go.mod file isn't changed
run: |
git diff --exit-code go.mod
git diff --exit-code go.sum
- name: Install dependencies
run: |
# redocly CLI
npm i -g redoc-cli
# yq
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq
chmod +x yq
export PATH=${PATH}:`pwd`
- name: Generate HTML doc
run: (cd v1 && make gen-html)
- name: Commit changes
run: .github/workflows/commit-changes.sh
env:
WATCH_DIR: "v1/html"
GIT_AUTHOR_NAME: ${{ github.actor }}
GIT_AUTHOR_EMAIL: ${{ github.actor }}@users.noreply.github.com
GIT_COMMITTER_NAME: GitHub Actions
GIT_COMMITTER_EMAIL: [email protected]
GIT_COMMIT_MESSAGE: |
[auto generated] Checking in generated offline HTML doc
BRANCH_REF: ${{ github.event.pull_request.head.ref }}
REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}