Skip to content

Commit

Permalink
GitHub Action to install TGF
Browse files Browse the repository at this point in the history
  • Loading branch information
jonapich committed Jul 12, 2024
1 parent 307c4ee commit c2f74ee
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
posix:
strategy:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
Expand All @@ -23,3 +24,18 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: ./get-latest-tgf.ps1

action:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- uses: ./
with:
ref: ${{ github.head_ref }}

- run: tgf --help-tgf
30 changes: 30 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Install TGF
description: GitHub Action to install https://github.com/coveooss/tgf

inputs:
tgf-path:
description: Installs the TGF binary to this folder. The folder is not added to the path.
required: false
ref:
description: The ref to use to run the install script.
default: master
required: false

runs:
using: "composite"
steps:
- name: Install TGF (posix)
if: runner.os != 'Windows'
shell: bash
env:
TGF_PATH: ${{ inputs.tgf-path }}
VERSION: ${{ inputs.ref }}
run: curl https://raw.githubusercontent.com/coveooss/tgf/${VERSION}/get-latest-tgf.sh | bash

- name: Install TGF (windows)
if: runner.os == 'Windows'
shell: bash
env:
TGF_PATH: ${{ inputs.tgf-path }}
VERSION: ${{ inputs.ref }}
run: (Invoke-WebRequest https://raw.githubusercontent.com/coveooss/tgf/${VERSION}/get-latest-tgf.ps1).Content | Invoke-Expression

0 comments on commit c2f74ee

Please sign in to comment.