name: Install Script
on:
workflow_run:
workflows: ["Release"]
types:
- completed
branches:
- main
pull_request:
paths:
- 'scripts/install.sh'
- '.github/workflows/test-install.yml'
jobs:
test-install:
if: ${{ github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success' }}
name: Test Install Script
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
shell: bash
sudo: sudo
install_dir: /usr/local/bin
- os: macos-latest
shell: bash
sudo: sudo
install_dir: /usr/local/bin
- os: windows-latest
shell: msys2 {0}
sudo: ""
install_dir: /mingw64/bin
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- uses: actions/checkout@v4
- name: Setup MSYS2
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: curl
- name: Test installation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INSTALL_DIR: ${{ matrix.install_dir }}
run: |
# Test local install
chmod +x ./scripts/install.sh
./scripts/install.sh
which cmt
cmt --version
# Test remote install
${{ matrix.sudo }} rm -f $(which cmt)
export BRANCH="${{ github.event_name == 'pull_request' && github.head_ref || 'main' }}"
curl -sSL "https://raw.githubusercontent.com/clifton/cmt/${BRANCH}/scripts/install.sh" | sh
which cmt
cmt --version