-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (112 loc) · 3.41 KB
/
ci_cd.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: GitHub CI
on:
pull_request:
push:
tags:
- "*"
branches:
- main
env:
MAIN_PYTHON_VERSION: '3.12'
DOCUMENTATION_CNAME: 'ansys.github.io/allie-flowkit'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
style:
name: Code style
runs-on: ubuntu-latest
steps:
- name: Install required tools
run : |
sudo apt install golang-golang-x-tools
sudo snap install golangci-lint --classic
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python for pre-commit hook
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Run pre-commit hook
uses: pre-commit/[email protected]
build:
name: Build project
needs: [style]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache-dependency-path: 'go.sum'
- name: Verify library builds
run: |
go build ./pkg/externalfunctions
doc-style:
name: "Documentation style"
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/doc-style@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
doc-build:
name: "Build project documentation"
runs-on: ubuntu-latest
steps:
- name: "Build project documentation"
uses: ansys/actions/doc-build@v8
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-python-cache: false
skip-install: true
requirements-file: doc/requirements.txt
check-links: false
doc-api-reference:
name: "Build API reference documentation"
needs: [doc-build, doc-style]
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Build GoPages
run: |
go install github.com/johnstarich/go/gopages@latest
gopages -internal -source-link "https://github.com/ansys/allie-flowkit/blob/main/{{.Path}}{{if .Line}}#L{{.Line}}{{end}}"
- name: Download HTML documentation artifacts
uses: actions/download-artifact@v4
with:
name: documentation-html
path: documentation-html
- name: Download and execute Python script
run: |
curl -o doc_api_reference.py https://raw.githubusercontent.com/ansys/allie-sharedtypes/main/pkg/scripts/doc_api_reference.py
python doc_api_reference.py ansys allie-flowkit
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: documentation-html-with-api
path: documentation-html
upload_dev_docs:
name: Upload dev documentation
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [doc-api-reference]
steps:
- name: Deploy the latest documentation
uses: ansys/actions/doc-deploy-dev@v8
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: documentation-html-with-api