-
Notifications
You must be signed in to change notification settings - Fork 41
101 lines (82 loc) · 2.53 KB
/
workflow.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
95
96
97
98
99
100
101
on: [push, pull_request_target]
name: Test and lint
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: npm test
package_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: "Ensure that code has been packaged and commited"
run: |-
npm install
npm run package
git diff --exit-code dist/index.js || \
(echo -e "\nPlease run 'npm run package' and commit the results" && exit 1)
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@master
- name: Install doctl
uses: ./
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Verify installation
run: doctl version
- name: Verify log-in
run: doctl compute region list
test_no_auth:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@master
- name: Install doctl
uses: ./
with:
no_auth: true
- name: Verify installation
run: doctl version
- name: Verify not authenticated
run: |
doctl compute region list 2>&1 | grep -qi "Unable to initialize DigitalOcean API client: access token is required"
test_custom_version_linux_and_mac:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@master
- name: Install doctl
uses: ./
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
version: 1.100.0
- name: Verify installation of correct version
run: |
VERSION=$(doctl version | head -1 | cut -f3 -d' ' | cut -f1 -d'-')
if [ "$VERSION" != "1.100.0" ]; then exit 1; fi
- name: Verify log-in
run: doctl compute region list
test_custom_version_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Install doctl
uses: ./
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
version: 1.100.0
- name: Verify installation of correct version
run: |
$VERSION = (doctl version | head -1 | cut -f3 -d' ' | cut -f1 -d'-')
If (-NOT ($VERSION -eq "1.100.0")) { exit 1 }
- name: Verify log-in
run: doctl compute region list