1
- # Copyright (c) Microsoft Corporation.
2
- # Licensed under the MIT License.
3
-
4
1
name : Build CI
5
-
6
2
on :
7
3
push :
8
4
branches :
12
8
pull_request :
13
9
branches :
14
10
- main
15
- workflow_call :
16
- inputs :
17
- BUILD_FLAGS :
18
- description : ' additional build flags to pass to build'
19
- default : ' '
20
- required : false
21
- type : string
22
- os :
23
- description : os to use in the run
24
- type : string
25
- default : ' ["ubuntu-latest", "macos-latest", "windows-latest"]'
26
- required : false
27
11
28
12
jobs :
29
13
build :
30
- env :
31
- BUILD_FLAGS : ${{ inputs.BUILD_FLAGS }}
32
- runs-on : ${{ matrix.os }}
33
- strategy :
34
- fail-fast : false
35
- matrix :
36
- os : ${{ fromJson(inputs.os) }} # [ ubuntu-latest, macos-latest, windows-latest ]
37
-
38
-
39
- steps :
40
- - name : Checkout
41
- uses : actions/checkout@v2
42
-
43
- # Node 16 matches the version of Node used by VS Code when this was
44
- # written, but it should be updated when VS Code updates its Node version.
45
- # Node needs to be installed before OS-specific setup so that we can run
46
- # the hash verification script.
47
- - name : Use Node 18.x
48
- uses : actions/setup-node@v2
49
- with :
50
- node-version : 18.x
51
-
52
- # On new macos-latest machines, Python 3.9+ is used, and it's causing issues with binding.gyp
53
- - name : Use Python 3.8
54
- if : ${{ matrix.os == 'macos-latest' }}
55
- uses : actions/setup-python@v5
56
- with :
57
- python-version : 3.8
58
-
59
- - name : Windows setup
60
- if : ${{ matrix.os == 'windows-latest' }}
61
- run : |
62
- curl -LO https://downloads.arduino.cc/arduino-1.8.19-windows.zip
63
- node build/checkHash.js arduino-1.8.19-windows.zip `
64
- c704a821089eab2588f1deae775916219b1517febd1dd574ff29958dca873945
65
- 7z x arduino-1.8.19-windows.zip -o"$Env:TEMP\arduino-ide"
66
- echo "$Env:TEMP\arduino-ide\arduino-1.8.19" | Out-File -FilePath $env:GITHUB_PATH -Append
67
- - name : Linux setup
68
- if : ${{ matrix.os == 'ubuntu-latest' }}
69
- run : |
70
- export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0
71
- sleep 3
72
- wget https://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz -P /home/$USER
73
- node build/checkHash.js /home/$USER/arduino-1.8.19-linux64.tar.xz \
74
- eb68bddc1d1c0120be2fca1350a03ee34531cf37f51847b21210b6e70545bc9b
75
- tar -xvf /home/$USER/arduino-1.8.19-linux64.tar.xz -C /home/$USER/
76
- sudo ln -s /home/$USER/arduino-1.8.19/arduino /usr/bin/arduino
77
- sudo apt-get update
78
- sudo apt-get install -y g++-multilib build-essential libudev-dev
79
- - name : macOS setup
80
- if : ${{ matrix.os == 'macos-latest' }}
81
- run : |
82
- /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
83
- brew install arduino --cask
84
-
85
- # Windows agents already have gulp installed.
86
- - name : Install gulp
87
- if : ${{ matrix.os != 'windows-latest' }}
88
- run : npm install --global gulp
89
- - name : Install global dependencies
90
- run : npm install --global node-gyp vsce
91
- - name : Install project dependencies
92
- run : npm install
93
-
94
- - name : Check for linting errors
95
- run : gulp tslint
96
- - name : Build and pack extension
97
- if : ${{ matrix.os != 'windows-latest' }}
98
- run : |
99
- export NODE_OPTIONS="--openssl-legacy-provider --no-experimental-fetch"
100
- node build/package.js ${{ env.BUILD_FLAGS }}
101
- - name : Build and pack extension (windows)
102
- if : ${{ matrix.os == 'windows-latest' }}
103
- run : |
104
- $env:NODE_OPTIONS="--openssl-legacy-provider --no-experimental-fetch"
105
- node build/package.js ${{ env.BUILD_FLAGS }}
106
- - name : Publish extension VSIX as artifact
107
- uses : actions/upload-artifact@v2
108
- with :
109
- name : VS Code extension VSIXes (${{ matrix.os }})
110
- path : out/vsix
111
-
112
- - name : Run tests
113
- uses : GabrielBB/xvfb-action@v1
114
- with :
115
- run : npm test --silent
14
+ uses : ./.github/workflows/templates/build.yml
15
+
0 commit comments