-
Notifications
You must be signed in to change notification settings - Fork 35
61 lines (50 loc) · 1.59 KB
/
main.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
name: CI
on:
push:
pull_request:
jobs:
tests:
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
# Latest minor release of Go 1.24:
go-version: ^1.24
- name: Ensure all files were formatted as per gofmt
if: matrix.os == 'ubuntu-latest'
run: |
[ "$(gofmt -l $(find . -name '*.go') 2>&1)" = "" ]
- name: golangci-lint
if: matrix.os == 'ubuntu-latest'
uses: golangci/golangci-lint-action@v6
- name: install rsync
if: matrix.os == 'ubuntu-latest'
run: |
docker build --pull --no-cache --rm -t=rsync-debian -f testdata/ci-debian.Dockerfile .
docker build --pull --no-cache --rm -t=rsync-fedora -f testdata/ci-fedora.Dockerfile .
- name: install rsync
if: matrix.os == 'windows-latest'
run: choco install rsync
- name: run tests (linux)
if: matrix.os == 'ubuntu-latest'
run: |
go test -v ./...
echo "::group::rsync from Debian"
docker run -v $PWD:/usr/src/rsync/ -w /usr/src/rsync rsync-debian go test ./...
echo "::endgroup::"
echo "::group::rsync from Fedora"
docker run -v $PWD:/usr/src/rsync/ -w /usr/src/rsync rsync-fedora go test ./...
echo "::endgroup::"
- name: run tests (macos)
if: matrix.os == 'macos-latest'
run: sudo go test -v ./...
- name: run tests (windows)
if: matrix.os == 'windows-latest'
run: go install ./cmd/...