-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathconfig.yml
More file actions
110 lines (106 loc) · 3.4 KB
/
Copy pathconfig.yml
File metadata and controls
110 lines (106 loc) · 3.4 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
# Note: CC_TEST_REPORTER_ID, the env var required to upload test coverage to Code Climate, is set from the CircleCI web
# interface as a private environment variable.
# https://app.circleci.com/settings/project/github/RITlug/teleirc/environment-variables
# https://circleci.com/docs/2.0/configuration-reference
version: 2.1
workflows:
main:
jobs:
- go_1-18
- go_1-19
- go_1-20
- go_1-25
- build_docs
commands:
golintci-lint:
description: Run linter checks on TeleIRC.
steps:
- checkout
- run:
name: Download and install golintci-lint.
command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v1.43.0
- run:
name: Run Go linter checks.
command: golangci-lint run
teleirc-test:
description: Run Go tests for TeleIRC.
steps:
- checkout
- run:
name: Run Go test suite.
command: go test -coverprofile=c.out ./...
jobs:
go_1-18:
docker:
- image: cimg/go:1.18
steps:
- golintci-lint
- teleirc-test
go_1-19:
docker:
- image: cimg/go:1.19
steps:
- golintci-lint
- teleirc-test
go_1-20:
docker:
- image: cimg/go:1.20
steps:
- golintci-lint
- run:
name: Initialize Code Climate test-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > /tmp/cc-test-reporter
chmod +x /tmp/cc-test-reporter
/tmp/cc-test-reporter before-build
- teleirc-test
- run:
name: Upload test coverage results to Code Climate.
# sed removes the package prefix, which is not a local path in directory
command: |
sed -i 's/github.com\/ritlug\/teleirc\///g' c.out
/tmp/cc-test-reporter after-build
go_1-25:
docker:
- image: cimg/go:1.25
steps:
- checkout
- run:
name: Download and install golintci-lint.
command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $(go env GOPATH)/bin v2.6.1
- run:
name: Run Go linter checks.
command: golangci-lint run
- teleirc-test
- run:
name: Display test coverage summary.
command: |
go tool cover -func=c.out
echo "Total coverage:"
go tool cover -func=c.out | grep total | awk '{print $3}'
- run:
name: Generate HTML coverage report.
command: go tool cover -html=c.out -o coverage.html
- store_artifacts:
path: coverage.html
destination: coverage-report
build_docs:
docker:
- image: cimg/python:3.10
steps:
- checkout
- restore_cache:
name: Restoring Python pip cache for Sphinx and dependencies.
key: teleirc-docs-pipenv-{{ checksum "docs/requirements.txt" }}
- run:
name: Install dependencies via pip.
command: pip install -r docs/requirements.txt
- save_cache:
name: Saving Python pip cache for Sphinx and dependencies.
key: teleirc-docs-pipenv-{{ checksum "docs/requirements.txt" }}
paths:
- /home/circleci/.pyenv
- run:
name: Build Sphinx documentation site.
command: sh docs/build_docs.sh