Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit e526296

Browse files
committed
Remove deploy and add Windows test to GH actions
1 parent dcd8a45 commit e526296

File tree

1 file changed

+50
-90
lines changed

1 file changed

+50
-90
lines changed

.github/workflows/build.yml

+50-90
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
name: CI-Tests
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
name: CI
5+
26
on:
37
push:
48
branches:
@@ -11,110 +15,66 @@ on:
1115
- master
1216
- dev
1317

14-
1518
jobs:
1619
build:
17-
runs-on: ${{ matrix.os }}
20+
runs-on: ${{ matrix.os }}
1821
strategy:
22+
fail-fast: false
1923
matrix:
2024
os: [ ubuntu-latest, macos-latest, windows-latest ]
21-
25+
2226
steps:
23-
- name: checkout
24-
uses: actions/checkout@v2
25-
- name: get node
26-
uses: actions/setup-node@v1
27-
with:
28-
node-version: 11.x
29-
- name: linux setup
27+
- name: Windows setup
28+
if: ${{ matrix.os == 'windows-latest' }}
29+
run: |
30+
curl -LO https://downloads.arduino.cc/arduino-1.8.19-windows.zip
31+
7z x arduino-1.8.19-windows.zip -o"$Env:TEMP\arduino-ide"
32+
echo "$Env:TEMP\arduino-ide\arduino-1.8.19" | Out-File -FilePath $env:GITHUB_PATH -Append
33+
- name: Linux setup
3034
if: ${{ matrix.os == 'ubuntu-latest' }}
3135
run: |
3236
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0
3337
sleep 3
34-
wget https://downloads.arduino.cc/arduino-1.8.2-linux64.tar.xz -P /home/$USER
35-
tar -xvf /home/$USER/arduino-1.8.2-linux64.tar.xz -C /home/$USER/
36-
sudo ln -s /home/$USER/arduino-1.8.2/arduino /usr/bin/arduino
38+
wget https://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz -P /home/$USER
39+
tar -xvf /home/$USER/arduino-1.8.19-linux64.tar.xz -C /home/$USER/
40+
sudo ln -s /home/$USER/arduino-1.8.19/arduino /usr/bin/arduino
3741
sudo apt-get update
38-
sudo apt-get install g++-multilib
39-
sudo apt-get install -y build-essential
40-
sudo apt-get install libudev-dev
41-
- name: macos setup
42+
sudo apt-get install -y g++-multilib build-essential libudev-dev
43+
- name: macOS setup
4244
if: ${{ matrix.os == 'macos-latest' }}
43-
run: |
45+
run: |
4446
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
4547
brew install arduino --cask
46-
- name: preinstall
47-
run: |
48-
npm install -g node-gyp
49-
npm install -g vsce@"^1.0.0"
50-
npm install -g gulp
51-
- name: install
52-
run: npm install
53-
- name: scripts
54-
run: |
55-
gulp tslint
56-
vsce package
57-
- name: run tests
48+
49+
- name: Checkout
50+
uses: actions/checkout@v2
51+
52+
# Node 14 matches the version of Node used by VS Code when this was
53+
# written, but it should be updated when VS Code updates its Node version.
54+
- name: Use Node 14.x
55+
uses: actions/setup-node@v2
56+
with:
57+
node-version: 14.x
58+
# Windows agents already have gulp installed.
59+
- name: Install gulp
5860
if: ${{ matrix.os != 'windows-latest' }}
61+
run: npm install --global gulp
62+
- name: Install global dependencies
63+
run: npm install --global node-gyp vsce
64+
- name: Install project dependencies
65+
run: npm install
66+
67+
- name: Check for linting errors
68+
run: gulp tslint
69+
- name: Build and pack extension
70+
run: vsce package --out vscode-arduino.vsix
71+
- name: Publish extension VSIX as artifact
72+
uses: actions/upload-artifact@v2
73+
with:
74+
name: VS Code extension VSIX (${{ matrix.os }})
75+
path: vscode-arduino.vsix
76+
77+
- name: Run tests
5978
uses: GabrielBB/xvfb-action@v1
6079
with:
6180
run: npm test --silent
62-
63-
deploy:
64-
needs: build
65-
runs-on: ubuntu-latest
66-
environment: vsix-publishing
67-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
68-
steps:
69-
- run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
70-
- run: echo ${{env.VERSION}}
71-
- name: Checkout
72-
uses: actions/checkout@v2
73-
- name: get node
74-
uses: actions/setup-node@v1
75-
with:
76-
node-version: 11.x
77-
- name: linux setup
78-
run: |
79-
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0
80-
sleep 3
81-
sudo apt-get update
82-
sudo apt-get install g++-multilib
83-
sudo apt-get install -y build-essential
84-
sudo apt-get install libudev-dev
85-
- name: preinstall
86-
run: |
87-
npm install -g node-gyp
88-
npm install -g vsce@"^1.0.0"
89-
npm install -g gulp
90-
- name: install
91-
run: npm install
92-
- name: scripts
93-
run: |
94-
gulp tslint
95-
gulp genAikey
96-
vsce package
97-
- name: upload .vsix to github tag
98-
uses: svenstaro/upload-release-action@v2
99-
with:
100-
repo_token: ${{ secrets.OAUTH_TOKEN }}
101-
file: ${{github.workspace}}/vscode-arduino*.vsix
102-
tag: ${{ github.ref }}
103-
overwrite: true
104-
file_glob: true
105-
- name: check for production tag
106-
id: check-version
107-
run: |
108-
if [[ ${{ env.VERSION }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
109-
echo ::set-output name=ISPRODUCTION::true
110-
fi
111-
# Skip attempting to publish for now, because I can't figure out how to
112-
# generate a valid VSCE_TOKEN. Instead we can manually publish by uploading
113-
# the release build artifact to the extension publisher site.
114-
- name: publish
115-
if: false && steps.check-version.outputs.ISPRODUCTION == 'true'
116-
env:
117-
PROD_AIKEY: ${{ secrets.PROD_AIKEY }}
118-
run: |
119-
gulp genAikey
120-
vsce publish -p ${{ secrets.VSCE_TOKEN }}

0 commit comments

Comments
 (0)