-
-
Notifications
You must be signed in to change notification settings - Fork 26
94 lines (84 loc) · 2.51 KB
/
pre-release.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
name: Pre-release
on:
workflow_dispatch:
jobs:
build:
name: Build
# https://github.com/actions/virtual-environments/
runs-on: ubuntu-20.04
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
# https://github.com/marketplace/actions/setup-go-environment
- name: 🔧 Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'gcosts/go.mod'
cache-dependency-path: 'gcosts/go.sum'
- name: 🍳 Build gcosts
run: cd gcosts && make
# Test binary
- name: 🌡️ Test gcosts
run: cd gcosts && ./gcosts help
- name: 🌡️ Test gcosts region
run: cd gcosts && ./gcosts region -p ../pricing.yml
- name: 🌡️ Test gcosts compute instance
run: cd gcosts && ./gcosts compute instance -p ../pricing.yml
# Test gcosts calc with pricing.yml
- name: 🌡️ Test gcosts calc
run: |
cd t && \
./../gcosts/gcosts calc -p ../pricing.yml && \
bash test.sh
# Upload binaries
# https://github.com/marketplace/actions/upload-a-build-artifact
- name: 📤 Upload
uses: actions/upload-artifact@v4
with:
name: gcosts-artifact
path: gcosts/gcosts-*
retention-days: 1
test-linux:
name: Test Linux
needs: build
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
# Download binaries
# https://github.com/marketplace/actions/download-a-build-artifact
- name: 📥 Download
uses: actions/download-artifact@v4
with:
name: gcosts-artifact
# Test binary
- name: 🌡️ Test
run: chmod +x gcosts-linux-x86_64 && ./gcosts-linux-x86_64 help
test-macos:
name: Test macOS
needs: build
runs-on: macos-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 📥 Download
uses: actions/download-artifact@v4
with:
name: gcosts-artifact
# Test binary
- name: 🌡️ Test
run: chmod +x gcosts-macos-x86_64 && ./gcosts-macos-x86_64 help
test-windows:
name: Test Windows
needs: build
runs-on: windows-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 📥 Download
uses: actions/download-artifact@v4
with:
name: gcosts-artifact
# Test binary
- name: 🌡️ Test
run: .\gcosts-windows-x86_64.exe help