-
Notifications
You must be signed in to change notification settings - Fork 66
68 lines (65 loc) · 1.79 KB
/
ci.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
67
68
name: Meshery Linkerd Workflow
on:
# No one should be pushing to master directly.
push:
branches:
- master
pull_request:
branches:
- master
paths:
- '**.go'
- '**.yml'
- '**.yaml'
jobs:
detect_changes:
runs-on: ubuntu-latest
outputs:
go_changes: ${{ steps.filter.outputs.go_changes }}
yaml_changes: ${{ steps.filter.outputs.yaml_changes }}
steps:
- uses: actions/checkout@master
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
go_changes:
- '**.go'
yaml_changes:
- '**.yml'
- '**.yaml'
golangci-lint:
runs-on: ubuntu-latest
needs: detect_changes
if: needs.detect_changes.outputs.go_changes == 'true'
steps:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: 1.23
- name: Checkout repository
uses: actions/checkout@master
- name: Run Linters
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=5m
codecov:
name: Code Coverage
if: github.repository == 'meshery/meshery-linkerd'
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.23.x
- name: Run unit tests
run: go test --short ./... -race -coverprofile=coverage.txt -covermode=atomic
- name: Upload coverage to Codecov
if: github.repository == 'meshery/meshery-linkerd'
uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
flags: unittests