Skip to content

Commit 98030ff

Browse files
committed
fixup
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent 83d5b43 commit 98030ff

3 files changed

Lines changed: 42 additions & 9 deletions

File tree

.github/workflows/go-test.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
with:
2929
version: latest
3030
only-new-issues: true
31-
skip-cache: true
32-
- name: Linting complete
31+
skip-cache: false
32+
- name: Linting complete # <- report summary when we have good news to report
3333
run: |
3434
echo "### Your changes to the go code look good. 👍" >> $GITHUB_STEP_SUMMARY
3535
echo "" >> $GITHUB_STEP_SUMMARY
@@ -39,7 +39,7 @@ jobs:
3939
unit_tests:
4040
name: Unit tests
4141
# description: |
42-
# Run go unit tests run 6x: linux, mac & windows on the 2 latest go versions.
42+
# Run go unit tests run x6: linux, mac & windows on the 2 latest go versions.
4343
#
4444
# Run tests with the -race flag.
4545
#
@@ -56,16 +56,15 @@ jobs:
5656

5757
strategy:
5858
matrix:
59-
#os: [ ubuntu-latest, macos-latest, windows-latest ]
60-
os: [ ubuntu-latest ]
59+
os: [ ubuntu-latest, macos-latest, windows-latest ]
6160
go_version: ['oldstable', 'stable' ]
6261

6362
steps:
6463
- uses: actions/setup-go@v5
6564
with:
6665
go-version: '${{ matrix.go_version }}'
6766
check-latest: true
68-
cache: true
67+
cache: true # <- cache key is go.sum
6968

7069
- uses: actions/checkout@v5
7170

@@ -114,19 +113,21 @@ jobs:
114113
steps:
115114
- name: Tests complete
116115
run: |
117-
echo "All tests completed. 👍" >> $GITHUB_STEP_SUMMARY
116+
echo "### All tests completed. 👍" >> $GITHUB_STEP_SUMMARY
117+
echo "" >> $GITHUB_STEP_SUMMARY
118+
echo "> ℹ️ INFO: we run unit tests in 6 different configurations of OS and go version." >> $GITHUB_STEP_SUMMARY
119+
echo "> At this moment, we don't run architecture-specific test runs" >> $GITHUB_STEP_SUMMARY
118120
echo "" >> $GITHUB_STEP_SUMMARY
119121
echo "| go version | OS | Result |" >> $GITHUB_STEP_SUMMARY
120122
echo "|------------|----|--------|" >> $GITHUB_STEP_SUMMARY
121123
declare -a lines
122124
eval "lines=($(echo $test_result|tr ',' ' '))"
123125
for line in "${lines[@]}";do echo "${line}" ; done >> $GITHUB_STEP_SUMMARY
124-
cat $GITHUB_STEP_SUMMARY
125126
126127
some_failed_tests:
127128
name: Some tests have failed
128129
# description: |
129-
# This job is only here to report a summary of failed tests in the github actions UI
130+
# This job is only here to report a summary of failed tests in the github actions UI.
130131
needs: [ unit_tests ] # <- requires all unit_tests jobs to be completed, but not necessarily successfully.
131132
if: ${{ needs.unit_tests.result == 'failure' }}
132133
env:

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,28 @@ Common CI workflows and setup for go-openapi repos.
66
* shared dependabot config
77

88
NOTE: at this moment, it is difficult to share the golangci-lint config, so that one is not shared yet.
9+
10+
## Motivation
11+
12+
It took a while, but we eventually managed to align all checks, tests and dependabot rules declared in the
13+
family of go-openapi repos.
14+
15+
Now we'd like to be able to maintain, enrich and improve these checks without worrying too much about
16+
the burden to replicate it about a dozen times.
17+
18+
## Contemplated enhancements
19+
20+
* [] enrich github actions UI with a job summary
21+
* [] addition go.sum cache for tests
22+
* [] share mono repo workflows (see github.com/go-openapi/swag/.github/workflows)
23+
* [] manage somehow to share golangci config (with local merge)
24+
* [] manage somehow to share / replicate dependabot config
25+
* [] add markdown linting for docs
26+
* [] add spellcheck for docs (and code?)
27+
* [] use non-blocking, scheduled, proactive full linting to check for the impact of new linters, new go versions etc
28+
* [] (possibility) take over hugo & doc gen part from go-swagger
29+
* [] (possibility) take over release part from go-swagger
30+
* [] produce hugo github page with all latest tagged versions (incl. mono repo)
31+
* [] add bot to filter PRs, issues
32+
* [] check with github API that all repo settings (branch protection rules, etc) are identical
33+
* [] comment PRs and issues

sample/sample_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
package sample
22

33
import (
4+
"runtime"
45
"testing"
56

67
"github.com/stretchr/testify/require"
78
)
89

910
func TestSample(t *testing.T) {
11+
if runtime.GOOS == "windows" {
12+
require.Equal(t, 0, Sample()) // make the test fail on windows
13+
14+
return
15+
}
16+
1017
require.Equal(t, 1, Sample())
1118
}

0 commit comments

Comments
 (0)