mirror of
https://github.com/dcarbone/install-jq-action.git
synced 2026-02-12 11:06:55 +08:00
quick & dirty 1.7 support (#4)
This commit is contained in:
9
.github/workflows/example-linux.yaml
vendored
9
.github/workflows/example-linux.yaml
vendored
@@ -6,12 +6,12 @@ on:
|
||||
version:
|
||||
type: string
|
||||
required: false
|
||||
description: "Version of jq to install"
|
||||
default: "1.6"
|
||||
description: 'Version of jq to install'
|
||||
default: '1.7'
|
||||
force:
|
||||
type: boolean
|
||||
required: false
|
||||
description: "Do not check for existing jq installation before continuing."
|
||||
description: 'Do not check for existing jq installation before continuing.'
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
@@ -19,12 +19,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Setup jq'
|
||||
uses: dcarbone/install-jq-action@v1.0.1
|
||||
uses: dcarbone/install-jq-action@v2.0.0
|
||||
with:
|
||||
version: '${{ inputs.version }}'
|
||||
force: '${{ inputs.force }}'
|
||||
|
||||
- name: 'Check jq'
|
||||
# language=sh
|
||||
run: |
|
||||
which jq
|
||||
jq --version
|
||||
|
||||
9
.github/workflows/example-macos.yaml
vendored
9
.github/workflows/example-macos.yaml
vendored
@@ -6,12 +6,12 @@ on:
|
||||
version:
|
||||
type: string
|
||||
required: false
|
||||
description: "Version of jq to install"
|
||||
default: "1.6"
|
||||
description: 'Version of jq to install'
|
||||
default: '1.7'
|
||||
force:
|
||||
type: boolean
|
||||
required: false
|
||||
description: "Do not check for existing jq installation before continuing."
|
||||
description: 'Do not check for existing jq installation before continuing.'
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
@@ -19,12 +19,13 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: 'Setup jq'
|
||||
uses: dcarbone/install-jq-action@v1.0.1
|
||||
uses: dcarbone/install-jq-action@v2.0.0
|
||||
with:
|
||||
version: '${{ inputs.version }}'
|
||||
force: '${{ inputs.force }}'
|
||||
|
||||
- name: 'Check jq'
|
||||
# language=sh
|
||||
run: |
|
||||
which jq
|
||||
jq --version
|
||||
|
||||
9
.github/workflows/example-windows.yaml
vendored
9
.github/workflows/example-windows.yaml
vendored
@@ -6,12 +6,12 @@ on:
|
||||
version:
|
||||
type: string
|
||||
required: false
|
||||
description: "Version of jq to install"
|
||||
default: "1.6"
|
||||
description: 'Version of jq to install'
|
||||
default: '1.7'
|
||||
force:
|
||||
type: boolean
|
||||
required: false
|
||||
description: "Do not check for existing jq installation before continuing."
|
||||
description: 'Do not check for existing jq installation before continuing.'
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
@@ -19,12 +19,13 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: 'Setup jq'
|
||||
uses: dcarbone/install-jq-action@v1.0.1
|
||||
uses: dcarbone/install-jq-action@v2.0.0
|
||||
with:
|
||||
version: '${{ inputs.version }}'
|
||||
force: '${{ inputs.force }}'
|
||||
|
||||
- name: 'Check jq'
|
||||
# language=powershell
|
||||
run: |
|
||||
Get-Command "jq.exe"
|
||||
jq.exe --version
|
||||
|
||||
15
.github/workflows/tests.yaml
vendored
15
.github/workflows/tests.yaml
vendored
@@ -21,13 +21,11 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
image:
|
||||
- "ubuntu-latest"
|
||||
- "ubuntu-20.04"
|
||||
- "ubuntu-22.04"
|
||||
- "macos-latest"
|
||||
- "ubuntu-20.04"
|
||||
- "macos-13"
|
||||
- "macos-11"
|
||||
- "macos-12"
|
||||
- "windows-latest"
|
||||
- "windows-2022"
|
||||
- "windows-2019"
|
||||
force:
|
||||
@@ -36,6 +34,7 @@ jobs:
|
||||
version:
|
||||
- '1.5'
|
||||
- '1.6'
|
||||
- '1.7'
|
||||
name: "Test Action - (img: ${{ matrix.image }}; version: ${{ matrix.version }}; force: ${{ matrix.force }})"
|
||||
runs-on: ${{ matrix.image }}
|
||||
steps:
|
||||
@@ -50,7 +49,7 @@ jobs:
|
||||
|
||||
- name: Check jq - Unix-ish
|
||||
if: (runner.os == 'Linux' || runner.os == 'macOS') && matrix.force == 'true'
|
||||
shell: bash +e {0}
|
||||
# language=sh
|
||||
run: |
|
||||
_err=
|
||||
_which="$(which jq)"
|
||||
@@ -71,7 +70,7 @@ jobs:
|
||||
|
||||
- name: Check Outputs - Unix-ish
|
||||
if: runner.os == 'Linux' || runner.os == 'macOS'
|
||||
shell: bash -e {0}
|
||||
# language=sh
|
||||
run: |
|
||||
_installed='${{ steps.install-jq.outputs.installed }}'
|
||||
_err=
|
||||
@@ -107,11 +106,12 @@ jobs:
|
||||
|
||||
- name: Check jq - Windows-ish
|
||||
if: runner.os == 'Windows' && matrix.force == 'true'
|
||||
# language=powershell
|
||||
run: |
|
||||
Get-Command "jq.exe"
|
||||
$_cmd={jq.exe --version }
|
||||
$_vers=jq.exe --version 2>&1
|
||||
if ( "${_vers}" -ne "jq-${{ matrix.version }}" )
|
||||
if ( "${_vers}" -ne "jq-${{ matrix.version }}" -and "${_vers}" -ne "jq-${{ matrix.version }}-dirty" )
|
||||
{
|
||||
Write-Host "jq.exe --version returned unexpected value"
|
||||
Write-Host " Expected: jq-${{ matrix.version }}"
|
||||
@@ -122,6 +122,7 @@ jobs:
|
||||
- name: Check Outputs - Windows-ish
|
||||
if: runner.os == 'Windows'
|
||||
shell: powershell
|
||||
# language=powershell
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
Reference in New Issue
Block a user