Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github/workflows: add CI github action workflow #4

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: build

on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- *
pull_request:
branches:
- master

env:
GOPATH: /tmp/go
# Because some tests require explicit setting of GOPATH. TODO: FIX THEM.

jobs:
build:
name: ${{ matrix.os }} ${{ matrix.version }}
runs-on: ${{ matrix.os }}

if: "!contains(github.event.head_commit.message, 'SKIP CI')"
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
version: ['stable']

steps:
- name: Clone repository
uses: actions/checkout@v1

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'

- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: '1.14'

- name: Install dependencies
run: npm install

- name: Compile
run: npm run vscode:prepublish

- name: Install Go tools (Modules mode)
run: |
go version
go get github.com/acroca/go-symbols \
github.com/davidrjenni/reftools/cmd/fillstruct \
github.com/haya14busa/goplay/cmd/goplay \
github.com/mdempsky/gocode \
github.com/sqs/goreturns \
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
github.com/zmb3/gogetdoc \
golang.org/x/lint/golint \
golang.org/x/tools/cmd/gorename
env:
GO111MODULE: on

- name: Install Go tools (GOPATH mode)
run: |
go version
go get github.com/cweill/gotests/... \
github.com/rogpeppe/godef \
github.com/ramya-rao-a/go-outline
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
env:
GO111MODULE: off

- name: Run unit tests
run: npm run unit-test
continue-on-error: true

- name: Run tests
uses: GabrielBB/[email protected]
with:
run: npm run test
env:
CODE_VERSION: ${{ matrix.version }}
continue-on-error: ${{ matrix.version == 'insiders' }}

eslint:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'SKIP CI')"

steps:
- name: Clone repository
uses: actions/checkout@v1

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'

- name: Install Dependencies
run: 'npm install --frozen-lockfile'
shell: bash

- name: Lint check
run: npm run lint