-
Notifications
You must be signed in to change notification settings - Fork 13
151 lines (118 loc) · 4.8 KB
/
workflow.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Main Workflow
# use fields.git-main-branch to change from master
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
ocaml-compiler:
- 4.14.1
skip_test:
- false
build_vsix:
- true
include:
- os: ubuntu-latest
ocaml-compiler: 4.14.0
skip_test: true
build_vsix: false
runs-on: ${{ matrix.os }}
# use fields.github-workflow-env to add something here
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Retrieve opam cache
uses: actions/cache@v4
id: cache-opam
with:
path: ~/.opam
key: v4-${{ runner.os }}-superbol-studio-oss-${{ matrix.ocaml-compiler }}-${{ hashFiles('opam/*.opam') }}-skip_tests=${{ matrix.skip_test }}-repo=
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: avsm/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-pin: false
- name: Set git user
run: |
git config --global user.name github-actions
git config --global user.email github-actions-bot@users.noreply.github.com
# use fields.opam-repo = "git+https://" to add an 'extra' opam repository
- run: opam pin add . -y --no-action
if: ${{ ! steps.cache-opam.outputs.cache-hit }}
# - run: opam depext -y superbol-studio-oss superbol-vscode-platform polka-js-stubs interop-js-stubs node-js-stubs vscode-js-stubs vscode-languageclient-js-stubs vscode-json vscode-debugadapter vscode-debugprotocol superbol-free superbol_free_lib superbol_preprocs superbol_project cobol_common cobol_parser cobol_ptree ebcdic_lib cobol_lsp ppx_cobcflags pretty cobol_config cobol_indent cobol_indent_old cobol_preproc cobol_data cobol_typeck cobol_unit ez_toml ezr_toml sql_ast sql_parser cobol_cfg
# if: ${{ ! steps.cache-opam.outputs.cache-hit }}
- run: |
if ${{ matrix.skip_test }}
then opam install -y opam/*.opam --deps-only
else opam install -y opam/*.opam --deps-only --with-test
fi
if: ${{ ! steps.cache-opam.outputs.cache-hit }}
name: Run opam install -y opam/*.opam --deps-only [ --with-test ]
# - run: opam upgrade --fixup
# if: steps.cache-opam.outputs.cache-hit
# Use fields.build-scripts to add more scripts to convert here
- run: dos2unix scripts/*.sh
if: matrix.os == 'windows-latest'
# Use fields.github-workflow-before-build to add something here
- run: git submodule init
- run: git submodule update
- uses: actions/setup-node@v4
with:
node-version: '>=16'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
if: matrix.build_vsix
- run: make build
# Use fields.github-workflow-after-build to add something here
- run: make check-package.json
- run: make dev-deps # install test dependencies
if: ${{ ! matrix.skip_test }}
- run: make test
if: ${{ ! matrix.skip_test }}
- name: Show test result on failure
if: failure()
run: cat _build/_autofonce/results.log
# Use fields.github-workflow-after-test to add something here
- run: yarn install && npm install esbuild
if: matrix.build_vsix
- run: make vsix-debug
if: matrix.build_vsix
- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: VSIX-${{ matrix.os }}
path: superbol-vscode-platform-*.vsix
compression-level: 0 # no compression (already a zip archive)
if: matrix.build_vsix
# - name: Check whether source is well formatted
# run: make fmt
# continue-on-error: true
# if: matrix.ocaml-compiler == '4.14.1' && matrix.os == 'ubuntu-latest'
- name: Build documentation
if: github.ref == 'refs/heads/master' && matrix.ocaml-compiler == '4.14.1' && matrix.os == 'ubuntu-latest'
run: |
sudo apt install -yqq python3-sphinx python3-sphinx-rtd-theme
opam install -y dune odoc
make doc
touch _drom/docs/.nojekyll
touch _drom/docs/sphinx/.nojekyll
touch _drom/docs/doc/.nojekyll
- name: Deploy documentation
uses: JamesIves/github-pages-deploy-action@3.6.2
if: github.ref == 'refs/heads/master' && matrix.ocaml-compiler == '4.14.1' && matrix.os == 'ubuntu-latest'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: _drom/docs/
CLEAN: true
# Use fields.github-workflow-trailer to add a trailer here