-
Notifications
You must be signed in to change notification settings - Fork 8
145 lines (121 loc) · 3.52 KB
/
tests.yml
File metadata and controls
145 lines (121 loc) · 3.52 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
name: tests
on: [push]
jobs:
check:
name: Go ${{ matrix.go }} checks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: [ 'stable', 'oldstable' ]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y asciidoc docbook-utils docbook-xml libxml2-utils xsltproc
- name: Build sshproxy
run: make
- name: Run checks
run: make get-deps check
- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: coverage-${{ matrix.go }}
path: test/coverage.out
coverage:
name: Publish Coverage
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download coverage artifact
uses: actions/download-artifact@v8
with:
name: coverage-stable
- name: Setup go
uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Convert go coverage to corbetura format
run: |
go install github.com/boumenot/gocover-cobertura@latest
gocover-cobertura -by-files < coverage.out > coverage.xml
- name: Get PR number
uses: jwalton/gh-find-current-pr@v1
id: finder
- name: Add Coverage PR Comment
if: steps.finder.outputs.number
uses: 5monkeys/cobertura-action@master
with:
path: coverage.xml
skip_covered: false
minimum_coverage: 0
fail_below_threshold: true
pull_request_number: ${{ steps.finder.outputs.pr }}
test:
name: Docker tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Run tests
run: make test
binary-archive:
name: Publish binary archive
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup go
uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Build sshproxy
run: make binary-archive
- name: Attach binary archive to release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "sshproxy_*.tar.gz"
tags: true
draft: true
rpm:
name: Publish RPMs
runs-on: ubuntu-latest
container:
image: fedora:latest
options: --privileged
steps:
- name: Prepare mock and rpm-build
run: |
dnf -y install asciidoc git golang make rpm-build
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Create source archive
run: |
git config --global --add safe.directory /__w/sshproxy/sshproxy
make source-archive
- name: Build RPMs
run: |
mkdir -p ~/rpmbuild/SOURCES
mv sshproxy-*.tar.gz ~/rpmbuild/SOURCES/
rpmbuild -ba misc/sshproxy.spec
- name: Attach RPM and SRPM to release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "/github/home/rpmbuild/RPMS/x86_64/*.rpm;/github/home/rpmbuild/SRPMS/*.rpm"
tags: true
draft: true