-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (77 loc) · 2.33 KB
/
test-setup.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
name: Tests suite for "setup-scalingo"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
# Test that the action installs the CLI
# and that the scalingo CLI returns its version number
test-latest-version:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest, macos-11, macos-12]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup scalingo CLI
uses: ./
with:
region: 'osc-fr1'
- name: Check version
run: |
# given
latest_version=$(curl -sL https://cli-dl.scalingo.com/version)
# when
installed_version=$(scalingo --version)
# then
echo $latest_version
echo $installed_version
echo "${installed_version}" | grep -q "${latest_version}"
# Test that the action installs a specific version of the CLI
# and that the scalingo CLI returns its version number
test-specific-version:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest, macos-11, macos-12]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup scalingo CLI
uses: ./
with:
version: 1.28.1
region: 'osc-fr1'
- name: Check version
run: |
# given
wanted_version=1.28.1
# when
installed_version=$(scalingo --version)
# then
echo "${installed_version}" | grep -q "${wanted_version}"
# Test that the installed CLI is logged when the API Token is provided
test-login:
if: ${{ github.repository == 'scalingo-community/setup-scalingo' }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest, macos-11, macos-12]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup scalingo CLI
uses: ./
with:
region: 'osc-fr1'
api_token: ${{ secrets.SCALINGO_API_TOKEN }}
- name: Check login
run: |
# given
expected_username="${{ secrets.SCALINGO_USERNAME }}"
# when
logged_user=$(scalingo whoami)
# then
echo "${logged_user}" | grep -q "${expected_username}"