Skip to content

Commit eb5be03

Browse files
committed
codec: workflow: separate workflows for master vs devel branches
1 parent d940c4d commit eb5be03

File tree

1 file changed

+41
-17
lines changed

1 file changed

+41
-17
lines changed

.github/workflows/test.yml

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,35 @@ on:
33
workflow_dispatch: {}
44
push:
55
branches: [ master, devel ]
6-
paths: [ '**.go' ]
6+
paths: [ '**.go', '.github/workflows/*' ]
77
pull_request:
88
branches: [ master ]
9-
paths: [ '**.go' ]
9+
paths: [ '**.go', '.github/workflows/*' ]
1010
jobs:
11-
tests:
11+
master_tests:
12+
if: github.ref_name == 'master'
1213
strategy:
1314
fail-fast: false
1415
matrix:
15-
go: [ '1.24', '1.22', '1.19', '1.17', '1.11' ]
16+
go: [ '1.24', '1.19', '1.17', '1.11' ]
1617
arch: [ amd64 ]
1718
os: [ ubuntu-latest ]
1819
include:
19-
- go: '1.22'
20+
- go: '1.19'
2021
arch: '386'
2122
os: ubuntu-latest
2223
runs-on: ${{ matrix.os }}
2324
env:
2425
GO111MODULE: 'on'
25-
COVER_GO_VERSION: '1.22'
26+
COVER_GO_VERSION: '1.19'
2627
GOARCH: ${{ matrix.arch }}
27-
name: go ${{ matrix.go }} on ${{ matrix.arch }}
28+
name: go ${{ matrix.go }} on ${{ matrix.arch }} at branch ${{ github.ref_name }}
2829
steps:
2930
- uses: actions/checkout@v3
3031
- uses: actions/setup-go@v3
3132
with:
3233
go-version: ${{ matrix.go }}
33-
- shell: bash
34-
run: cd codec; go get github.com/google/go-cmp/cmp
35-
if: github.ref_name == 'devel'
3634
- name: Run tests
37-
if: >-
38-
(github.ref_name == 'master' && matrix.go == '1.24') ||
39-
(github.ref_name == 'master' && matrix.go == '1.19') ||
40-
(github.ref_name == 'master' && matrix.go == '1.17') ||
41-
(github.ref_name == 'master' && matrix.go == '1.11') ||
42-
(github.ref_name == 'devel' && matrix.go == '1.24') ||
43-
(github.ref_name == 'devel' && matrix.go == '1.22')
4435
shell: bash
4536
run: |
4637
cd codec
@@ -53,6 +44,39 @@ jobs:
5344
if: matrix.go == env.COVER_GO_VERSION
5445
with:
5546
directory: ./codec
47+
devel_tests:
48+
if: github.ref_name == 'devel'
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
go: [ '1.24', '1.22' ]
53+
arch: [ amd64 ]
54+
os: [ ubuntu-latest ]
55+
include:
56+
- go: '1.22'
57+
arch: '386'
58+
os: ubuntu-latest
59+
runs-on: ${{ matrix.os }}
60+
env:
61+
GO111MODULE: 'on'
62+
GOARCH: ${{ matrix.arch }}
63+
name: go ${{ matrix.go }} on ${{ matrix.arch }} at branch ${{ github.ref_name }}
64+
steps:
65+
- uses: actions/checkout@v3
66+
- uses: actions/setup-go@v3
67+
with:
68+
go-version: ${{ matrix.go }}
69+
- shell: bash
70+
run: cd codec; go get github.com/google/go-cmp/cmp
71+
- name: Run tests
72+
shell: bash
73+
run: |
74+
cd codec
75+
go mod edit -droprequire github.com/ugorji/go
76+
t=( "" "safe" "notfastpath" "notmono" )
77+
for i in "${t[@]}"; do
78+
go test "-tags=alltests ${i}" "-run=Suite" "-coverprofile=coverage.${{ matrix.go }}.${{ matrix.arch }}.${i}.txt"
79+
done
5680
5781
5882
# No need to go get, as github knows its working out of this folder.

0 commit comments

Comments
 (0)