Skip to content

Commit 7bcec4e

Browse files
committed
github/workflows: add CI github action workflow
Ideally I want the CI to run from Gerrit because that will be our primary change review system, but the internal system is not ready yet. This is a temporary solution that uses Github Action. The CI workflow kicks in for every PR and every commit on the master. Change-Id: I97c9d20f4649c4cafd7a984c02fa84d0bc70f554 GitHub-Last-Rev: 948b555 GitHub-Pull-Request: #4 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/222921 Reviewed-by: Rebecca Stambler <[email protected]>
1 parent 341a4ff commit 7bcec4e

File tree

1 file changed

+105
-0
lines changed

1 file changed

+105
-0
lines changed

.github/workflows/ci.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: build
2+
3+
on:
4+
# Trigger the workflow on push or pull request,
5+
# but only for the master branch
6+
push:
7+
branches:
8+
- *
9+
pull_request:
10+
branches:
11+
- master
12+
13+
env:
14+
GOPATH: /tmp/go
15+
# Because some tests require explicit setting of GOPATH. TODO: FIX THEM.
16+
17+
jobs:
18+
build:
19+
name: ${{ matrix.os }} ${{ matrix.version }}
20+
runs-on: ${{ matrix.os }}
21+
22+
if: "!contains(github.event.head_commit.message, 'SKIP CI')"
23+
timeout-minutes: 20
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
os: [ubuntu-latest]
28+
version: ['stable']
29+
30+
steps:
31+
- name: Clone repository
32+
uses: actions/checkout@v1
33+
34+
- name: Setup Node
35+
uses: actions/setup-node@v1
36+
with:
37+
node-version: '10.x'
38+
39+
- name: Setup Go
40+
uses: actions/setup-go@v1
41+
with:
42+
go-version: '1.14'
43+
44+
- name: Install dependencies
45+
run: npm install
46+
47+
- name: Compile
48+
run: npm run vscode:prepublish
49+
50+
- name: Install Go tools (Modules mode)
51+
run: |
52+
go version
53+
go get github.com/acroca/go-symbols \
54+
github.com/davidrjenni/reftools/cmd/fillstruct \
55+
github.com/haya14busa/goplay/cmd/goplay \
56+
github.com/mdempsky/gocode \
57+
github.com/sqs/goreturns \
58+
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
59+
github.com/zmb3/gogetdoc \
60+
golang.org/x/lint/golint \
61+
golang.org/x/tools/cmd/gorename
62+
env:
63+
GO111MODULE: on
64+
65+
- name: Install Go tools (GOPATH mode)
66+
run: |
67+
go version
68+
go get github.com/cweill/gotests/... \
69+
github.com/rogpeppe/godef \
70+
github.com/ramya-rao-a/go-outline
71+
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
72+
env:
73+
GO111MODULE: off
74+
75+
- name: Run unit tests
76+
run: npm run unit-test
77+
continue-on-error: true
78+
79+
- name: Run tests
80+
uses: GabrielBB/[email protected]
81+
with:
82+
run: npm run test
83+
env:
84+
CODE_VERSION: ${{ matrix.version }}
85+
continue-on-error: ${{ matrix.version == 'insiders' }}
86+
87+
eslint:
88+
runs-on: ubuntu-latest
89+
if: "!contains(github.event.head_commit.message, 'SKIP CI')"
90+
91+
steps:
92+
- name: Clone repository
93+
uses: actions/checkout@v1
94+
95+
- name: Setup Node
96+
uses: actions/setup-node@v1
97+
with:
98+
node-version: '10.x'
99+
100+
- name: Install Dependencies
101+
run: 'npm install --frozen-lockfile'
102+
shell: bash
103+
104+
- name: Lint check
105+
run: npm run lint

0 commit comments

Comments
 (0)