-
-
Notifications
You must be signed in to change notification settings - Fork 25
59 lines (51 loc) · 1.74 KB
/
test.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
name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
name: Test
# https://github.com/actions/virtual-environments/
runs-on: ubuntu-latest
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 🔧 Install dependencies
run: |
sudo apt-get install \
libapp-options-perl \
libwww-perl \
libjson-xs-perl \
libyaml-libyaml-perl \
libdbd-csv-perl \
libdbd-sqlite3-perl
# https://github.com/marketplace/actions/setup-go-environment
- name: 🔧 Setup go
uses: actions/setup-go@v4
with:
go-version-file: 'gcosts/go.mod'
cache-dependency-path: 'gcosts/go.sum'
# Tests Perl scripts
- name: 🌡️ Test skus.pl
run: cd build && perl skus.pl --version
- name: 🌡️ Test mapping.pl
run: cd build && perl mapping.pl --version
- name: 🌡️ Test pricing.pl
run: cd build && perl pricing.pl --version
# https://github.com/marketplace/actions/run-golangci-lint
- name: 🌡️ Lint gcosts
uses: golangci/golangci-lint-action@v3
with:
working-directory: gcosts
- name: 🍳 Build gcosts
run: cd gcosts && make native && ./gcosts --version
# 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
- name: 🌡️ Test gcosts calc
run: cd gcosts && ./gcosts calc -d ../t -p ../pricing.yml