Skip to content

Commit 261bea2

Browse files
committed
Merge branch 'master' into 2655-Function-calls-via-delve-'call'-are-not-supported
2 parents 49b2904 + 93a25eb commit 261bea2

File tree

114 files changed

+4629
-2219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+4629
-2219
lines changed
Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
name: build
1+
name: Release (golang.go-nightly)
22

3-
on: [push, pull_request]
3+
# Daily release on 15:00 UTC, monday-thursday.
4+
# Or, force to release by triggering repository_dispatch events by using
5+
# curl -v -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/golang/vscode-go/dispatches -d '{ "event_type": "force-release" }'
6+
on:
7+
schedule:
8+
- cron: "0 15 * * MON-THU" # 15 UTC, monday-thursday daily
9+
repository_dispatch:
10+
types: [force-release]
411

512
jobs:
6-
build:
7-
name: ${{ matrix.os }} ${{ matrix.version }}
8-
runs-on: ${{ matrix.os }}
9-
10-
if: "!contains(github.event.head_commit.message, 'SKIP CI')"
13+
release:
14+
if: github.ref == 'refs/heads/master' && github.repository == 'golang/vscode-go'
15+
16+
name: Release Nightly
17+
runs-on: ubuntu-latest
1118
timeout-minutes: 20
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
os: [ubuntu-latest]
16-
version: ['stable']
1719

1820
steps:
1921
- name: Clone repository
@@ -30,8 +32,11 @@ jobs:
3032
go-version: '1.14'
3133

3234
- name: Install dependencies
33-
run: npm install
34-
35+
run: npm ci
36+
37+
- name: Prepare Release
38+
run: build/all.bash prepare_nightly
39+
3540
- name: Compile
3641
run: npm run vscode:prepublish
3742

@@ -48,9 +53,10 @@ jobs:
4853
golang.org/x/lint/golint \
4954
golang.org/x/tools/cmd/gorename \
5055
golang.org/x/tools/gopls
56+
5157
env:
52-
GO111MODULE: on
53-
58+
GO111MODULE: on
59+
5460
- name: Install Go tools (GOPATH mode)
5561
run: |
5662
go version
@@ -60,34 +66,24 @@ jobs:
6066
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
6167
env:
6268
GO111MODULE: off
63-
69+
70+
6471
- name: Run unit tests
6572
run: npm run unit-test
6673
continue-on-error: true
67-
74+
6875
- name: Run tests
6976
uses: GabrielBB/[email protected]
7077
with:
7178
run: npm run test
7279
env:
73-
CODE_VERSION: ${{ matrix.version }}
74-
75-
eslint:
76-
runs-on: ubuntu-latest
77-
if: "!contains(github.event.head_commit.message, 'SKIP CI')"
80+
CODE_VERSION: 'insiders'
81+
VSCODEGO_BEFORE_RELEASE_TESTS: true
7882

79-
steps:
80-
- name: Clone repository
81-
uses: actions/checkout@v1
82-
83-
- name: Setup Node
84-
uses: actions/setup-node@v1
83+
- name: Publish
84+
if: github.ref == 'refs/heads/master' && github.repository == 'golang/vscode-go'
85+
uses: lannonbr/vsce-action@704da577da0f27de5cdb4ae018374c2f08b5f523
8586
with:
86-
node-version: '10.x'
87-
88-
- name: Install Dependencies
89-
run: 'npm install --frozen-lockfile'
90-
shell: bash
91-
92-
- name: Lint check
93-
run: npm run lint
87+
args: "publish -p $VSCE_TOKEN"
88+
env:
89+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}

.github/workflows/release.yml

Lines changed: 82 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,100 @@
1-
name: release
1+
name: Release (golang.go)
22

3-
# Daily release on 15:00 UTC, monday-thursday.
4-
# Or, force to release by triggering repository_dispatch events by using
5-
# curl -v -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/golang/vscode-go/dispatches -d '{ "event_type": "force-release" }'
6-
on:
7-
schedule:
8-
- cron: "0 15 * * MON-THU" # 15 UTC, monday-thursday daily
9-
repository_dispatch:
10-
types: [force-release]
3+
# The new release workflow is triggered when a new tag on the release
4+
# branch is pushed.
5+
#
6+
# Note: our canonical repository is in go.googlesource.com/vscode-go and tagging
7+
# will be done in the canonical repository, and mirrored to the github repository.
8+
# A typical workflow is:
9+
#
10+
# 1. A human operator creates a CL to merge the main dev branch to the 'release' branch.
11+
# CI (GCB builder) will test the CL.
12+
# 2. The CL is reviewed and merged. This triggers the "Long test workflow" (test-long.yml).
13+
# 3. The human operator verifies the "Long test workflow" is green.
14+
# Otherwise, fix (fix, cherry-pick, review, commit) on the 'release' branch.
15+
# 4. When the 'release' branch reaches to the state ready for the release,
16+
# the human operator will tag the commig from the canonical repository.
17+
# (https://go-review.googlesource.com/admin/repos/vscode-go,tags)
18+
# Stable versions should be in the format of 'vX.X.X' (e.g. v0.15.0)
19+
# Release candidates should be in the format of 'vX.X.X-rc.X' (e.g. v0.15.0-rc.1)
20+
# 5. The gopherbot will mirror the tag to the GitHub repo, and that push will trigger
21+
# the 'Release (golang.go)' workflow specified in this file.
22+
# - For stable version release (vX.X.X), check if the package.json has the matching version.
23+
# - Packaging using 'vsce package'
24+
# - Create a release in Github
25+
# - Upload the vsix file as an asset of the release
26+
# - For stable version release (vX.X.X), upload to the vscode market place
27+
# (not implemented in this CL)
1128

12-
env:
13-
GOPATH: /tmp/go
14-
# Because some tests require explicit setting of GOPATH. TODO: FIX THEM.
29+
on:
30+
push:
31+
tags:
32+
- v*
1533

1634
jobs:
17-
release:
18-
name: Release Nightly
35+
build:
36+
name: create release
1937
runs-on: ubuntu-latest
20-
timeout-minutes: 20
2138

2239
steps:
23-
- name: Clone repository
24-
uses: actions/checkout@v1
40+
- name: checkout code
41+
uses: actions/checkout@v2
2542

26-
- name: Setup Node
27-
uses: actions/setup-node@v1
28-
with:
29-
node-version: '10.x'
43+
- name: get release version
44+
id: release_version
45+
run: |
46+
TAGGED_VERSION="${GITHUB_REF/refs\/tags\/v/}"
3047
31-
- name: Setup Go
32-
uses: actions/setup-go@v1
33-
with:
34-
go-version: '1.14'
48+
if [[ ! "${TAGGED_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
49+
echo "Invalid version tag '${TAGGED_VERSION}'"
50+
exit 1
51+
fi
3552
36-
- name: Install dependencies
37-
run: npm install
53+
echo ::set-env name=EXT_VERSION::"${TAGGED_VERSION}"
54+
WRITTEN_VERSION="$(cat package.json | jq '.version' -r)"
3855
39-
- name: Install Go tools (Modules mode)
40-
run: |
41-
go version
42-
go get github.com/acroca/go-symbols \
43-
github.com/davidrjenni/reftools/cmd/fillstruct \
44-
github.com/haya14busa/goplay/cmd/goplay \
45-
github.com/mdempsky/gocode \
46-
github.com/sqs/goreturns \
47-
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
48-
github.com/zmb3/gogetdoc \
49-
golang.org/x/lint/golint \
50-
golang.org/x/tools/cmd/gorename
51-
env:
52-
GO111MODULE: on
56+
if [[ ${TAGGED_VERSION} == *"-"* ]]; then
57+
echo ::set-env name=EXT_ISPREVIEW::1
58+
else
59+
if [[ "${TAGGED_VERSION}" != "${WRITTEN_VERSION}" ]]; then
60+
echo "Release Tag and Version in package.json do not match: '${TAGGED_VERSION}' vs '${WRITTEN_VERSION}'"
61+
exit 1
62+
fi
63+
echo ::set-env name=EXT_ISPREVIEW::0
64+
fi
5365
54-
- name: Install Go tools (GOPATH mode)
66+
- name: stamp version
5567
run: |
56-
go version
57-
go get github.com/cweill/gotests/... \
58-
github.com/rogpeppe/godef \
59-
github.com/ramya-rao-a/go-outline
60-
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
61-
env:
62-
GO111MODULE: off
68+
cat package.json | jq --arg VER "${{ env.EXT_VERSION }}" '.version=$VER' > /tmp/package.json
69+
cp /tmp/package.json ./package.json
70+
npm ci
71+
npm run vscode:prepublish
6372
64-
- name: Prepare Release
65-
run: build/all.bash prepare_nightly
66-
67-
- name: Run unit tests
68-
run: npm run unit-test
69-
continue-on-error: true
70-
71-
- name: Run tests
72-
uses: GabrielBB/[email protected]
73+
- name: package
74+
uses: lannonbr/vsce-action@704da577da0f27de5cdb4ae018374c2f08b5f523
7375
with:
74-
run: npm run test
75-
env:
76-
CODE_VERSION: 'insiders'
76+
args: "package"
7777

78-
- name: Publish
79-
if: github.ref == 'refs/heads/master' && github.repository == 'golang/vscode-go'
80-
uses: lannonbr/vsce-action@704da577da0f27de5cdb4ae018374c2f08b5f523
78+
- name: create release
79+
id: create_release
80+
uses: actions/create-release@v1
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8183
with:
82-
args: "publish -p $VSCE_TOKEN"
84+
tag_name: ${{ github.ref }}
85+
release_name: Release ${{ env.EXT_VERSION }}
86+
draft: false
87+
prerelease: ${{env.EXT_ISPREVIEW == 1}}
88+
89+
- name: upload release asset
90+
uses: actions/upload-release-asset@v1
8391
env:
84-
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
with:
94+
upload_url: ${{ steps.create_release.outputs.upload_url }}
95+
asset_path: ./go-${{ env.EXT_VERSION }}.vsix
96+
asset_name: go-${{ env.EXT_VERSION }}.vsix
97+
asset_content_type: application/zip
98+
# TODO: check if the commit is in green state. (test-long.yml results)
99+
# TODO: publish to the market if VERSION is for a stable version.
100+
# TODO: after publishing, create a gerrit CL to update 'latest' branch if VERSION is for a stable version.

.github/workflows/test-long.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Long Tests
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'latest'
7+
- 'upstream'
8+
9+
jobs:
10+
build:
11+
name: ${{ matrix.os }} ${{ matrix.version }}
12+
runs-on: ${{ matrix.os }}
13+
14+
# Not containing 'SKIP CI' in the commit message AND
15+
# (Either non-Windows OR triggered on 'push' (if triggered by 'pull_request', github.base_ref is not empty)
16+
if: github.repository == 'golang/vscode-go' && !contains(github.event.head_commit.message, 'SKIP CI')
17+
timeout-minutes: 20
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest, windows-latest, macos-latest]
22+
version: ['stable']
23+
24+
steps:
25+
- name: Clone repository
26+
uses: actions/checkout@v2
27+
28+
- name: Setup Node
29+
uses: actions/setup-node@v1
30+
with:
31+
node-version: '10.x'
32+
33+
- name: Setup Go
34+
uses: actions/setup-go@v1
35+
with:
36+
go-version: '1.14'
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Compile
42+
run: npm run vscode:prepublish
43+
44+
- name: Install Go tools (Modules mode)
45+
run: |
46+
go version
47+
go get github.com/acroca/go-symbols
48+
go get github.com/davidrjenni/reftools/cmd/fillstruct
49+
go get github.com/haya14busa/goplay/cmd/goplay
50+
go get github.com/mdempsky/gocode
51+
go get github.com/sqs/goreturns
52+
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
53+
go get github.com/zmb3/gogetdoc
54+
go get golang.org/x/lint/golint
55+
go get golang.org/x/tools/cmd/gorename
56+
go get golang.org/x/tools/gopls
57+
env:
58+
GO111MODULE: on
59+
60+
- name: Install Go tools (GOPATH mode)
61+
run: |
62+
go version
63+
go get github.com/cweill/gotests/...
64+
go get github.com/rogpeppe/godef
65+
go get github.com/ramya-rao-a/go-outline
66+
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
67+
env:
68+
GO111MODULE: off
69+
70+
- name: Run unit tests
71+
run: npm run unit-test
72+
continue-on-error: true
73+
74+
- name: Run tests
75+
uses: GabrielBB/[email protected]
76+
with:
77+
run: npm run test
78+
env:
79+
CODE_VERSION: ${{ matrix.version }}
80+
81+
- name: Lint check
82+
run: npm run lint
83+
if: ${{ matrix.os }} == 'ubuntu-latest'

0 commit comments

Comments
 (0)