-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from hashicorp/bshore/rewrite-sans-node
Rewrite sans node
- Loading branch information
Showing
29 changed files
with
202 additions
and
36,299 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
- package-ecosystem: "actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
interval: "weekly" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Lint GitHub Actions Workflows | ||
|
||
on: | ||
push: | ||
paths: | ||
- .github/** | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
actionlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
- name: "Check workflow files" | ||
uses: docker://docker.mirror.hashicorp.services/rhysd/actionlint:latest | ||
with: | ||
args: -color |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,86 @@ | ||
--- | ||
name: "Testing" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
github-token: | ||
type: string | ||
description: "GitHub token to use to download hc-releases" | ||
required: true | ||
version: | ||
type: string | ||
description: "Version of hc-releases to install" | ||
|
||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- 'releases/*' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
unit: | ||
runs-on: ubuntu-latest | ||
# TODO test on all supported platforms (need GH-hosted darwin runners) | ||
strategy: | ||
matrix: | ||
version: | ||
- '${{ inputs.version }}' | ||
- '0.1.14' # need not be the most recent | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: npm ci | ||
- name: npm mock tests | ||
run: npm run test -- --testPathIgnorePatterns hc-releases.live.test.js | ||
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | ||
|
||
# only use the live auth token for the tests that require it | ||
- name: npm live tests | ||
- name: "Install tools (only for running locally via act)" | ||
if: env.CI == 'true' && env.ACT == 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TOKEN_DOWNLOAD_RELAPI }} | ||
GH_TOKEN: ${{ inputs.github-token }} | ||
run: | | ||
npm test hc-releases.live.test.js | ||
run_quiet() { local logfile="${RUNNER_TEMP}/command.log" ; "$@" > "$logfile" 2>&1 || { cat "$logfile" ; exit 1 ; } ; } | ||
type -p curl >/dev/null || (apt update && apt install --yes curl) | ||
curl --silent --show-error --fail --location \ | ||
--output /usr/share/keyrings/githubcli-archive-keyring.gpg \ | ||
https://cli.github.com/packages/githubcli-archive-keyring.gpg | ||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list | ||
run_quiet apt update | ||
run_quiet apt install --yes gh | ||
gh --version | ||
# Install latest yq | ||
BINARY=yq_linux_amd64 | ||
VERSION="$(gh --repo=https://github.com/mikefarah/yq release list |awk '$2 == "Latest" { print $3 }')" | ||
gh --repo=https://github.com/mikefarah/yq release download "$VERSION" --clobber --output /usr/bin/yq --pattern "$BINARY" | ||
/bin/chmod 755 /usr/bin/yq | ||
yq --version | ||
- name: Install hc-releases | ||
uses: ./ | ||
id: install | ||
with: | ||
github-token: ${{ inputs.github-token || secrets.TOKEN_DOWNLOAD_RELAPI }} | ||
version: ${{ matrix.version }} | ||
|
||
- name: Test reported version | ||
run: | | ||
got_ver="${{ steps.install.outputs.version }}" | ||
if [ -z "$got_ver" ]; then | ||
echo "Failed to detect installed version: step output empty." 1>&2 | ||
exit 1 | ||
fi | ||
exp_ver="${{ matrix.version }}" | ||
if [ -z "$exp_ver" ]; then # default version according to action.yml | ||
exp_ver="$(yq eval .inputs.version.default action.yml)" | ||
fi | ||
if [ -z "$exp_ver" ]; then | ||
echo "Failed to determine expected version of hc-releases" 1>&2 | ||
exit 1 | ||
fi | ||
if [ "v${got_ver#v}" != "v${exp_ver#v}" ]; then | ||
echo "Incorrect hc-releases found (wrong version installed? target version not first in PATH?)" 1>&2 | ||
exit 1 | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,8 @@ | ||
node_modules/ | ||
|
||
# Editors | ||
.vscode/ | ||
.idea/ | ||
*.iml | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Other Dependency directories | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
# v3.0.0 | ||
|
||
NOTES | ||
|
||
- Rewrite action in bash | ||
- Bump default `hc-releases` version to 0.1.15 | ||
|
||
# v1.0.6 | ||
|
||
NOTES | ||
|
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
Oops, something went wrong.