forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGo.YAML
188 lines (158 loc) · 5.64 KB
/
Go.YAML
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Go Workflow with Cosmos SDK Integration
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
pull-requests: write
jobs:
build-and-test:
strategy:
matrix:
os: [ubuntu-24.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5.2.0
with:
go-version: '1.20'
cache: true
cache-dependency-path: go.sum
- name: Fetch Latest Cosmos SDK Version
run: |
# Fetch the latest release tag from GitHub
LATEST_VERSION=$(curl -s "https://api.github.com/repos/cosmos/cosmos-sdk/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
echo "Latest Cosmos SDK version: $LATEST_VERSION"
echo "COSMOS_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
- name: Update Go Modules
run: |
# Update go.mod with the latest Cosmos SDK version
go get github.com/cosmos/cosmos-sdk@${{ env.COSMOS_VERSION }}
go mod tidy
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- name: Check PR Title for Semantic Compliance
uses: amannn/action-semantic-pull-request@v5.5.3
with:
githubBaseUrl: https://api.github.com
- name: Add Sticky Pull Request Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼
We require PR titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
It looks like your title needs adjustment. Please see below:
No release type found in pull request title "{{ github.event.pull_request.title }}".
Add a prefix to indicate the type of release (e.g., `feat:` for new features). Refer to the guide above for available types.
windows-image-setup:
runs-on: ubuntu-22.04
steps:
- name: Define Windows Image Matrix
run: |
echo "Defining Windows image names for testing..."
WINDOWS_IMAGE_NAME="runner-images-windows-2022"
WINDOWS_IMAGE_NAME="runner-images-windows-2023"
WINDOWS_IMAGE_NAME="runner-images-windows-2024"
echo "Matrix setup complete."
- name: Setup BlockCypher Token Securely
env:
BLOCKCYPHER_TOKEN: ${{ secrets.BLOCKCYPHER_TOKEN }}
run: |
if [[ -z "$BLOCKCYPHER_TOKEN" ]]; then
echo "Error: BLOCKCYPHER_TOKEN not set."
exit 1
fi
echo "BLOCKCYPHER_TOKEN is set and secure."
- name: Sync Blockchain Cypher
run: |
echo "Synchronizing Blockchain Cypher with token..."
curl -X POST -H "Authorization: Bearer $BLOCKCYPHER_TOKEN" \
-d '{"action":"sync","target":"CosmosSDK"}' \
https://api.blockcypher.com/v1/blockchains/pulse
name: Go and .NET Workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
pull-requests: write
jobs:
build-and-test:
strategy:
matrix:
os: [ubuntu-24.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# Set up Go
- name: Set up Go
uses: actions/setup-go@v5.2.0
with:
go-version: '1.20'
cache: true
cache-dependency-path: go.sum
- name: Fetch Latest Cosmos SDK Version
run: |
LATEST_VERSION=$(curl -s "https://api.github.com/repos/cosmos/cosmos-sdk/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
echo "Latest Cosmos SDK version: $LATEST_VERSION"
echo "COSMOS_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
- name: Update Go Modules
run: |
go get github.com/cosmos/cosmos-sdk@${{ env.COSMOS_VERSION }}
go mod tidy
- name: Build Go Project
run: go build -v ./...
- name: Test Go Project
run: go test -v ./...
# Set up .NET
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
cache: true
- name: Restore .NET Dependencies
run: dotnet restore --locked-mode
- name: Build .NET Project
run: dotnet build <my-project-path>
- name: Test .NET Project
run: dotnet test <my-project-path>
# PR Title Check
- name: Check PR Title for Semantic Compliance
uses: amannn/action-semantic-pull-request@v5.5.3
with:
githubBaseUrl: https://api.github.com
- name: Add Sticky Pull Request Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
message: |
Hey there and thank you for opening this pull request! 👋🏼
Please ensure your PR title follows the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
Adjust the title as needed to include a release type.
dotnet-matrix-testing:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '3.1.x', '5.0.x', '6.0.x' ]
steps:
- uses: actions/checkout@v4
- name: Set up .NET for Matrix
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Create Temporary global.json
run: echo '{"sdk":{"version":"${{ matrix.dotnet }}"}}' > global.json
- name: Restore .NET Dependencies
run: dotnet restore --locked-mode
- name: Build Matrix .NET Project
run: dotnet build <my-project-path>
- name: Test Matrix .NET Project
run: dotnet test <my-project-path>