-
Notifications
You must be signed in to change notification settings - Fork 62
136 lines (112 loc) · 3.91 KB
/
Copy pathci.yml
File metadata and controls
136 lines (112 loc) · 3.91 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
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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-18.04, windows-latest]
# syntax explanation:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-additional-values-into-combinations
include:
- os: macos-latest
build: eval $(opam env) && cd analysis && make test -j
artifact-folder: darwin
- os: ubuntu-18.04
build: eval $(opam env) && cd analysis && make test -j
artifact-folder: linux
- os: windows-latest
build: "cd analysis && & $env:CYGWIN_ROOT\\bin\\ocaml-env exec -- make test -j"
artifact-folder: win32
runs-on: ${{matrix.os}}
steps:
# needed for Windows testing
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v2.3.4
- name: Cache OCaml's opam
uses: actions/cache@v2.1.5
with:
path: ~/.opam
key: ${{matrix.os}}-rescript-vscode-v3
- name: Use OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.12.x
- name: Use Node.js
uses: actions/setup-node@v2.1.5
with:
node-version: 14.4.0
- run: npm ci
- run: opam install dune
- run: npm run compile
# These 2 runs (or just the second?) are for when you have opam dependencies. We don't.
# Don't add deps. But if you ever do, un-comment these and add an .opam file.
# - run: opam pin add rescript-editor-analysis.dev . --no-action
# - run: opam install . --deps-only --with-doc --with-test
- name: Build and test
run: ${{matrix.build}}
# Also avoids artifacts upload permission loss:
# https://github.com/actions/upload-artifact/tree/ee69f02b3dfdecd58bb31b4d133da38ba6fe3700#permission-loss
- name: Compress files
run: |
cd analysis
mkdir ${{matrix.artifact-folder}}
mv rescript-editor-analysis.exe ${{matrix.artifact-folder}}
tar -cvf binary.tar ${{matrix.artifact-folder}}
- uses: actions/upload-artifact@v2
with:
name: ${{matrix.os}}
path: analysis/binary.tar
package:
needs: test
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2.3.4
- name: Use Node.js
uses: actions/setup-node@v2.1.5
with:
node-version: 14.4.0
- run: npm ci
- run: npm run compile
- name: Download MacOS binary
uses: actions/download-artifact@v3.0.0
with:
name: macos-latest
path: ./server/analysis_binaries
- run: tar -xvf binary.tar
working-directory: ./server/analysis_binaries
- name: Download Linux binary
uses: actions/download-artifact@v3.0.0
with:
name: ubuntu-18.04
path: ./server/analysis_binaries
- run: tar -xvf binary.tar
working-directory: ./server/analysis_binaries
- name: Download Windows binary
uses: actions/download-artifact@v3.0.0
with:
name: windows-latest
path: ./server/analysis_binaries
- run: tar -xvf binary.tar
working-directory: ./server/analysis_binaries
- name: Cleanup tar file
run: rm binary.tar
working-directory: ./server/analysis_binaries
- name: Store short commit SHA for filename
id: vars
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: echo "::set-output name=sha_short::${COMMIT_SHA:0:7}"
- name: Package Extension
run: npx vsce package -o rescript-vscode-${{ steps.vars.outputs.sha_short }}.vsix
- uses: actions/upload-artifact@v2
with:
name: rescript-vscode-${{ steps.vars.outputs.sha_short }}.vsix
path: rescript-vscode-${{ steps.vars.outputs.sha_short }}.vsix