This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 233
100 lines (90 loc) · 3.47 KB
/
build.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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
name: CI
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- name: Checkout
uses: actions/checkout@v2
# Node 16 matches the version of Node used by VS Code when this was
# written, but it should be updated when VS Code updates its Node version.
# Node needs to be installed before OS-specific setup so that we can run
# the hash verification script.
- name: Use Node 18.x
uses: actions/setup-node@v2
with:
node-version: 18.x
# On new macos-latest machines, Python 3.9+ is used, and it's causing issues with binding.gyp
- name: Use Python 3.8
if: ${{ matrix.os == 'macos-latest' }}
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Windows setup
if: ${{ matrix.os == 'windows-latest' }}
run: |
curl -LO https://downloads.arduino.cc/arduino-1.8.19-windows.zip
node build/checkHash.js arduino-1.8.19-windows.zip `
c704a821089eab2588f1deae775916219b1517febd1dd574ff29958dca873945
7z x arduino-1.8.19-windows.zip -o"$Env:TEMP\arduino-ide"
echo "$Env:TEMP\arduino-ide\arduino-1.8.19" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: Linux setup
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0
sleep 3
wget https://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz -P /home/$USER
node build/checkHash.js /home/$USER/arduino-1.8.19-linux64.tar.xz \
eb68bddc1d1c0120be2fca1350a03ee34531cf37f51847b21210b6e70545bc9b
tar -xvf /home/$USER/arduino-1.8.19-linux64.tar.xz -C /home/$USER/
sudo ln -s /home/$USER/arduino-1.8.19/arduino /usr/bin/arduino
sudo apt-get update
sudo apt-get install -y g++-multilib build-essential libudev-dev
- name: macOS setup
if: ${{ matrix.os == 'macos-latest' }}
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install arduino --cask
# Windows agents already have gulp installed.
- name: Install gulp
if: ${{ matrix.os != 'windows-latest' }}
run: npm install --global gulp
- name: Install global dependencies
run: npm install --global node-gyp vsce
- name: Install project dependencies
run: npm install
- name: Check for linting errors
run: gulp tslint
- name: Build and pack extension
if: ${{ matrix.os != 'windows-latest' }}
run: |
export NODE_OPTIONS="--openssl-legacy-provider --no-experimental-fetch"
node build/package.js
- name: Build and pack extension
if: ${{ matrix.os == 'windows-latest' }}
run: |
$env:NODE_OPTIONS="--openssl-legacy-provider --no-experimental-fetch"
node build/package.js
- name: Publish extension VSIX as artifact
uses: actions/upload-artifact@v2
with:
name: VS Code extension VSIXes (${{ matrix.os }})
path: out/vsix
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
run: npm test --silent