-
Notifications
You must be signed in to change notification settings - Fork 3
152 lines (135 loc) · 4.98 KB
/
main_full.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
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
146
147
148
149
150
151
152
name: Full checks
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch:
concurrency:
group: main-${{ github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
tests:
strategy:
fail-fast: false
matrix:
go-version: ["stable", "oldstable"]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
# TODO: Tests on windows are failing, paths are not crossplatform
- os: "windows-latest"
# TMP
- os: "macos-latest"
- go-version: "oldstable"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- run: go test -race -v -timeout 60s ${{ !startsWith(matrix.os, 'ubuntu') && '-short' || '' }} ./...
# builds:
# strategy:
# matrix:
# go-version: ["stable", "oldstable"]
# os: [ubuntu-latest, macos-latest, windows-latest]
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-go@v5
# with:
# go-version: ${{ matrix.go-version }}
# - name: Build fabric and plugins
# uses: goreleaser/goreleaser-action@v6
# with:
# distribution: goreleaser
# version: '~> v2'
# args: build --snapshot --clean --single-target
# golangci-lint:
# permissions:
# # Required: allow read access to the content for analysis.
# contents: read
# # Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-go@v5
# with:
# go-version: "stable"
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v6
# with:
# version: v1.59
# only-new-issues: true
# codegen-check:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Fetch all tags
# # checkout only gets the latest commit, so it has no tag info
# run: git fetch --depth=1 --tags
# - uses: actions/setup-go@v5
# with:
# go-version: "stable"
# - name: Restore cached codegen tools
# id: cache-tools
# uses: actions/cache/restore@v4
# with:
# key: codegen-tools-${{ runner.os }}-${{ hashFiles('./codegen/install.sh') }}
# path: ~/go/bin/
# - name: Install codegen tools
# if: steps.cache-tools.outputs.cache-hit != 'true'
# run: ./codegen/install.sh
# - name: Cache codegen tools
# if: steps.cache-tools.outputs.cache-hit != 'true'
# uses: actions/cache/save@v4
# with:
# key: ${{ steps.cache-tools.outputs.cache-primary-key }}
# path: ~/go/bin/
# - name: Regenerate code
# run: |
# ./codegen/rm_gen.sh
# ./codegen/gen.sh
# - name: Get changed files
# uses: tj-actions/verify-changed-files@v20
# id: codegen-changed-files
# - name: Format code
# run: |
# git reset --hard HEAD
# ./codegen/format.sh
# - name: Get changed files
# uses: tj-actions/verify-changed-files@v20
# id: format-changed-files
# - name: Verify that code is correctly generated and formatted
# if: steps.codegen-changed-files.outputs.files_changed == 'true' || steps.format-changed-files.outputs.files_changed == 'true'
# env:
# CODEGEN_CHANGED_FILES: ${{ steps.codegen-changed-files.outputs.changed_files }}
# FORMAT_CHANGED_FILES: ${{ steps.format-changed-files.outputs.changed_files }}
# run: |
# if [ -n "$CODEGEN_CHANGED_FILES" ]; then
# echo "Attempted to commit non up-to-date generated files:" >> $GITHUB_STEP_SUMMARY
# for file in $CODEGEN_CHANGED_FILES; do
# echo "* $file" >> $GITHUB_STEP_SUMMARY
# done
# cat <<"EOF" >> $GITHUB_STEP_SUMMARY
# Make sure that you have correct tools installed by running `./codegen/install.sh` and regenerate the files by running `./codegen/gen.sh` (`./codegen/rm_gen.sh` will remove all generated files)
# EOF
# echo "::error title=Need to regenerate code::Stale generated files: $CODEGEN_CHANGED_FILES"
# fi
# if [ -n "$FORMAT_CHANGED_FILES" ]; then
# echo "Attempted to commit non-formatted files:" >> $GITHUB_STEP_SUMMARY
# for file in $FORMAT_CHANGED_FILES; do
# echo "* $file" >> $GITHUB_STEP_SUMMARY
# done
# cat <<"EOF" >> $GITHUB_STEP_SUMMARY
# Format the code by running `./codegen/format.sh`
# EOF
# echo "::error title=Incorrect formatting::Badly formatted files: $FORMAT_CHANGED_FILES"
# fi
# exit 1