-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (49 loc) · 1.36 KB
/
ci.yml
File metadata and controls
55 lines (49 loc) · 1.36 KB
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
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
name: CI
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
jobs:
lint:
name: Lint and Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- name: Lint
run: |
# Apply automatic formatting.
gofmt -w .
goimports -local "github.com/hyperledger/fabric-x-common" -w .
# Re make protobufs and mocks, overwriting any formatting
PATH="$HOME/bin:$PATH" make proto
PATH="$HOME/bin:$PATH" make mocks
# Check if original code changed due to formatting.
git diff --exit-code
# Fetch main to only show new lint issues.
git fetch -u origin main:main
make lint
- name: Build tools
run: make tools
test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: scripts/install-dev-dependencies.sh
- run: make test-cover
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.profile