[COMPLIANCE] Add Copyright and License Headers (#6) #54
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
# Copyright (c) HashiCorp, Inc. | |
# SPDX-License-Identifier: MPL-2.0 | |
name: Test Installer | |
on: | |
push: | |
permissions: | |
contents: read | |
jobs: | |
test-install: | |
runs-on: ${{ matrix.target.runner }} | |
strategy: | |
matrix: | |
dest_dir: [ '', '/tmp/rcodesign' ] | |
target: | |
- { runner: 'ubuntu-latest' } | |
- { runner: 'macos-latest' } | |
# no GH-hosted ARM64 Mac runners available yet | |
#- { runner: ['self-hosted', 'ondemand', 'macos', 'arm64'] } | |
steps: | |
# for local act runs, install gh | |
- name: Install gh | |
if: ${{ env.ACT }} | |
env: | |
ARCHIVE: "https://github.com/cli/cli/releases/download/v2.45.0/gh_2.45.0_linux_amd64.tar.gz" | |
run: | | |
mkdir /tmp/gh | |
cd /tmp/gh | |
curl -LsSo gh.tar.gz "$ARCHIVE" | |
tar zxf gh.tar.gz | |
cp gh_*/bin/gh . | |
pwd >> "$GITHUB_PATH" | |
- name: Verify gh | |
if: ${{ env.ACT }} | |
run: | | |
which gh | |
gh --version | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install | |
uses: ./ | |
with: | |
# needed for installer to run gh tool | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
install-dir: ${{ matrix.dest_dir }} | |
- name: Check Default Installation Path | |
run: | | |
case "${{ matrix.dest_dir }}" in | |
'') exp_dir="${PWD}/.bob/tools" ;; | |
*) exp_dir="${{ matrix.dest_dir }}" ;; | |
esac | |
if ! grep "$exp_dir" <<< "$PATH" ; then | |
echo "Expected $exp_dir in PATH but it's absent." 1>&2 | |
exit 1 | |
fi | |
- name: Check tool can be run | |
run: rcodesign --version | |
script-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Run Shellcheck | |
uses: docker://koalaman/shellcheck:stable | |
with: | |
# inside the container, the working directory will be set to the mounted github workspace | |
args: "install-rcodesign.sh" |