Skip to content

Allow installing mac builds of rcodesign #44

Allow installing mac builds of rcodesign

Allow installing mac builds of rcodesign #44

Workflow file for this run

# 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: ['self-hosted', 'ondemand', 'macos', 'x64'] }
- { 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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- 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@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Run Shellcheck
uses: docker://koalaman/shellcheck:stable
with:
# running the step in a container mounts the workspace as below
args: "/github/workspace/install-rcodesign.sh"