-
Notifications
You must be signed in to change notification settings - Fork 36
66 lines (56 loc) · 1.77 KB
/
test.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
name: Test
on:
push:
branches:
- main
pull_request:
release:
types:
- published
- created
- edited
defaults:
run:
shell: bash
jobs:
test:
strategy:
matrix:
os:
- ubuntu-22.04 # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md
- macos-13 # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
- windows-2022 # https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
go-version:
- 1.18.x
- 1.19.x
- 1.20.x
neovim-version:
- v0.9.1
- nightly
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Set flag environment variable
run: |
echo "OS=$(echo ${{ runner.os }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "GO_VERSION=$(echo ${{ matrix.go-version }} | cut -d. -f-2)" >> $GITHUB_ENV
echo "NVIM_VERSION=$(if [ ${{ matrix.neovim-version }} != 'nightly' ]; then echo 'stable'; else echo 'nightly'; fi)" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Install neovim binary
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.neovim-version }}
- name: Test and take a coverage
run: |
go test -race -count=1 -covermode=atomic -coverpkg=./... -coverprofile=coverage.out ./...
- uses: codecov/codecov-action@v3
with:
file: coverage.out
flags: ${{ env.OS }}-${{ env.GO_VERSION }}-${{ env.NVIM_VERSION }}
env_vars: OS,GO_VERSION,NVIM_VERSION