Add no_auth
option: pre-release fork
#23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: v1.101.0-pre.git.f747827eb8e6 | |
- name: Verify installation of correct version | |
run: | | |
VERSION=$(doctl version | head -1 | cut -f3 -d' ' | cut -f1 -d'-') | |
if [ "$VERSION" != "1.101.0" ]; then exit 1; fi | |
VERSION=$(doctl version | grep -i 'Git commit' | cut -f2 -d':' | tr -d ' \n') | |
if [ "$GIT_SHA" != "Git commit hash: f747827e" ]; 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: v1.101.0-pre.git.f747827eb8e6 | |
- name: Verify installation of correct version | |
run: | | |
$VERSION = (doctl version | head -1 | cut -f3 -d' ' | cut -f1 -d'-') | |
If (-NOT ($VERSION -eq "1.101.0")) { exit 1 } | |
$GIT_SHA = (doctl version | grep -i 'Git commit' | cut -f2 -d':' | tr -d ' \n') | |
If (-NOT ($GIT_SHA -eq "f747827e")) { exit 1 } | |
- name: Verify log-in | |
run: doctl compute region list |