forked from bmaupin/go-epub
-
Notifications
You must be signed in to change notification settings - Fork 9
79 lines (65 loc) · 2.28 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
69
70
71
72
73
74
75
76
77
78
79
# Source: https://github.com/actions/starter-workflows/blob/main/ci/go.yml
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
# Test golangci-lint for go-version define in go.mod
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a #v5.2.0
with:
go-version-file: go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 #v6.1.1
with:
version: latest
only-new-issues: true
# Test with EPUBCheck and send test coverage
test-epubcheck:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
# This needs to come after the checkout, which wipes the working directory
- name: Download EPUBCheck
run: |
# Download the latest version of EPUBCheck
wget $(curl -Ls -H "Accept: application/vnd.github.v3+json" 'https://api.github.com/repos/IDPF/epubcheck/releases?per_page=1' | jq '.[0].assets[0].browser_download_url' -r)
unzip epubcheck-*.zip
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: ./go.mod
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -covermode=atomic -coverprofile=coverage.out ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # 5.1.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# Test Mac and Windows with the latest version of Go
test-mac-windows:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: ./go.mod
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...