-
Notifications
You must be signed in to change notification settings - Fork 21
47 lines (37 loc) · 1.14 KB
/
test.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
name: Go Test 🚀
on: [push, pull_request]
jobs:
build:
name: 🐹 Test with Go ${{ matrix.go-version }}
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- 1.20.x
- 1.21.x
- 1.22.x
- 1.23.x
steps:
- name: 🔄 Checkout Repository
uses: actions/checkout@v4
- name: 🛠️ Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: 📦 Install Dependencies
run: go mod download
- name: 🌐 Set CLOUDINARY_URL
run: |
export CLOUDINARY_URL=$(bash scripts/get_test_cloud.sh)
echo "CLOUDINARY_URL=$CLOUDINARY_URL" >> $GITHUB_ENV
echo "cloud_name: $(echo $CLOUDINARY_URL | cut -d'@' -f2)"
- name: 🧰 Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: 🧪 Run Tests
run: |
gotestsum --junitfile unit-tests.xml --format pkgname ./...
- name: 📊 Test Summary
uses: test-summary/action@v2
with:
paths: "unit-tests.xml"
if: always()