diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 5aa1b74..43c7a86 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -9,6 +9,7 @@ on: jobs: posix: strategy: + fail-fast: false matrix: os: [ macos-latest, ubuntu-latest ] runs-on: ${{ matrix.os }} @@ -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 diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..dea5176 --- /dev/null +++ b/action.yml @@ -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