This repository has been archived by the owner on Jan 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (74 loc) · 1.93 KB
/
build-and-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
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
name: build-and-test
on:
push:
branches:
- master
tags:
- "v*"
paths-ignore:
- "**.md"
pull_request:
branches:
- "*"
tags:
- "*"
paths-ignore:
- "**.md"
jobs:
multi-os:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout to coin
uses: actions/checkout@v2
- name: Environment info
run: echo $GITHUB_SHA $GITHUB_REF
- name: Install Crystal
run: bash "${GITHUB_WORKSPACE}/.github/install-crystal.sh"
env:
OS: "${{ matrix.os }}"
- name: Run tests
run: make tests
- name: MacOS pre-build steps
run: |
gem install bundler
brew install upx
if: ${{ matrix.os == 'macos-latest' }}
- name: Build coin
run: make build-release
- name: See info
run: |
./coin -h
./coin -v
- name: Run conversions
run: |
./coin 1 btc usd
./coin 2 xau usd eur nok rub
./coin 3.333 brl jpy pyg sll vef
./coin 0.04 usd aud twd nzd nad lrd kyd jmd hkd fjd
env:
FIXER_API_TOKEN: "${{ secrets.FIXER_API_TOKEN }}"
- name: Rename artifact
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
export ARTIFACT="coin-${GITHUB_SHA}-linux"
fi
if [ "${{ matrix.os }}" = "macos-latest" ]; then
export ARTIFACT="coin-${GITHUB_SHA}-macos"
fi
mv coin "$ARTIFACT"
ls -lash
echo "::set-env name=ARTIFACT::${ARTIFACT}"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: "${{ env.ARTIFACT }}"
path: "${{ env.ARTIFACT }}"
retention-days: 1