Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
fetch-depth: 0
-
name: Extract tag message
id: get_message
# git-cliff may or may not pick the current tag message, difficult to tell when
# this works. We extract the tag message explicitly.
id: get-message
# tag message is not retrieved unless with fetch the ref explictly
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
MESSAGE=$(git tag -l '${{ github.ref_name }}' --format='%(contents:subject)

%(contents:body)
Expand All @@ -41,6 +41,9 @@ jobs:
printenv MESSAGE
echo 'EOF'
} >> "${GITHUB_OUTPUT}"

echo "Message in git tag ${{ github.ref_name }}"
echo "$MESSAGE"
-
name: Generate release notes
id: notes
Expand All @@ -52,9 +55,10 @@ jobs:
config: '.cliff.toml'
args: >-
--current
--with-tag-message '${{ steps.get_message.outputs.message }}'
--with-tag-message '${{ steps.get-message.outputs.message }}'
-
name: Create github release
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
with:
body: ${{ steps.notes.outputs.content }}
generate_release_notes: false
18 changes: 10 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
pull_request:
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
lint-action:
name: Lint actions
Expand Down Expand Up @@ -43,21 +47,18 @@ jobs:

test-action:
name: Test install actions
runs-on: ubuntu-latest
permissions:
contents: read
runs-on: ${{ matrix.os }}
needs: [lint-action]
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
-
name: Checkout repository
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
-
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
# At this moment, one of the installed tools is not released as a binary and requires a go-setup
with:
go-version: stable
check-latest: true
cache: true
-
name: Run install-all action
id: test-action
uses: ./
Expand All @@ -68,3 +69,4 @@ jobs:
gotestsum --help
go-junit-report --help
go-ctrf-json-reporter --help
svu --help
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GitHub Actions used by go-openapi workflows.

## Status

This project is still in a very early stage. It is being actively developed and has not released yet.
These actions are currently used by the CI workflows run at `github.com/go-openapi`.

## Usage

Expand All @@ -36,9 +36,19 @@ To use this action in your workflow, reference it using the standard GitHub Acti
- uses: go-openapi/gh-actions/install/go-ctrf-json-reporter@v1
```

## Installed tools

All tools are currently installed using downloaded released binaries.

* [gotestsum](https://github.com/gotestyourself/gotestsum/)
* [go-junit-report](https://github.com/jstemmer/go-junit-report)
* [go-ctrf-json-reporter](https://github.com/ctrf-io/go-ctrf-json-reporter)
* [svu](https://github.com/caarlos0/svu)

## Motivation

This repository currently exposes "installer" actions for some testing go tools and
This repository currently exposes "installer" actions for some testing go tools.

CI workflows may use and pin released actions instead of resorting to a `go install ...@latest`
command.

Expand Down Expand Up @@ -78,8 +88,10 @@ This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE).
[codeql-badge]: https://github.com/go-openapi/gh-actions/actions/workflows/codeql.yml/badge.svg
[codeql-url]: https://github.com/go-openapi/gh-actions/actions/workflows/codeql.yml
<!-- Badges: release & docker images -->
[release-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fgh-actions.svg
[release-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fgh-actions
[release-badge]: https://badge.fury.io/gh/go-openapi%2Fgh-actions.svg
[release-url]: https://badge.fury.io/gh/go-openapi%2Fgh-actions
[gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fgh-actions.svg
[gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fgh-actions
<!-- Badges: code quality -->
[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/gh-actions
[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/gh-actions
Expand Down
39 changes: 38 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,82 @@ name: go-openapi composite action
description: |
Composite github action for go-openapi workflows.

It installs the following test tools from binary releases:
Installs the following test tools from binary releases:

* gotestsum
* go-junit-report
* go-ctrf-json-reporter
* svu

Please refer to [the documentation](./README.md).

author: go-openapi

inputs:
install-gotestsum:
default: 'true'
required: false
version-gotestsum:
default: auto
required: false
description: |
The version to install specifically.
Defaults to 'auto': the version currenty released (see go.mod).
install-go-junit-report:
default: 'true'
required: false
version-go-junit-report:
default: auto
required: false
description: |
The version to install specifically.
Defaults to 'auto': the version currenty released (see go.mod).
install-go-ctrf-json-reporter:
default: 'true'
required: false
version-go-ctrf-json-reporter:
default: auto
required: false
description: |
The version to install specifically.
Defaults to 'auto': the version currenty released (see go.mod).
install-svu:
default: 'true'
required: false
version-svu:
default: auto
required: false
description: |
The version to install specifically.
Defaults to 'auto': the version currenty released (see go.mod).

runs:
using: composite
steps:
-
if: ${{ inputs.install-gotestsum == 'true' }}
name: Install gotestsum
uses: ./install/gotestsum
with:
version: ${{ inputs.version-gotestsum }}
-
if: ${{ inputs.install-go-junit-report == 'true' }}
name: Install go-junit-report
uses: ./install/go-junit-report
with:
version: ${{ inputs.version-go-junit-report }}
-
if: ${{ inputs.install-go-ctrf-json-reporter == 'true' }}
name: Install go-ctrf-json-reporter
uses: ./install/go-ctrf-json-reporter
with:
version: ${{ inputs.version-go-ctrf-json-reporter }}
-
if: ${{ inputs.install-svu == 'true' }}
name: Install svu
uses: ./install/svu
with:
version: ${{ inputs.version-go-ctrf-json-reporter }}

branding:
icon: 'package'
Expand Down
3 changes: 3 additions & 0 deletions get-tool-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ case "${tool}" in
gotestsum)
GO_IMPORT_PATH="gotest.tools/gotestsum"
;;
svu)
GO_IMPORT_PATH="github.com/caarlos0/svu"
;;
*)
echo "Unrecognized tool name"
exit 1
Expand Down
21 changes: 12 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
module gh-actions

go 1.24.0
go 1.25.3

require (
github.com/ctrf-io/go-ctrf-json-reporter v0.0.14
github.com/caarlos0/svu/v3 v3.3.0
github.com/ctrf-io/go-ctrf-json-reporter v0.0.15
github.com/jstemmer/go-junit-report/v2 v2.1.0
gotest.tools/gotestsum v1.13.0
)

require (
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/bitfield/gotestdox v0.2.2 // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
golang.org/x/mod v0.27.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/term v0.35.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.36.0 // indirect
golang.org/x/mod v0.30.0 // indirect
golang.org/x/sync v0.18.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/term v0.37.0 // indirect
golang.org/x/text v0.31.0 // indirect
golang.org/x/tools v0.39.0 // indirect
)
38 changes: 32 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4=
github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE=
github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY=
github.com/caarlos0/svu/v3 v3.0.0 h1:nuKoqZKG1jHEq/RyKpsLKCcUHI2Uw/ZwBOfhq+x36AU=
github.com/caarlos0/svu/v3 v3.0.0/go.mod h1:aqzsE84JVirxxkIS1tzfilxmuHkkXu3FUfdGkbTlORE=
github.com/caarlos0/svu/v3 v3.3.0 h1:zjG8BQd5tWlr5kjqh5uJBnBEoNp0GfvFxGBIHgUcrjc=
github.com/caarlos0/svu/v3 v3.3.0/go.mod h1:WtAu3yAuNo4zOkvHxp4bk/RgFc8OCt+Tr/A7OtOK51M=
github.com/ctrf-io/go-ctrf-json-reporter v0.0.14 h1:/Yyx+wedA4i62+M1r+/LLNIJ0XK8GV/y7CUTVq/JMcg=
github.com/ctrf-io/go-ctrf-json-reporter v0.0.14/go.mod h1:36bVomyu0b70mpxgIQVllRXYyQFPSS+CeHZTn7zxYzQ=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ctrf-io/go-ctrf-json-reporter v0.0.15 h1:dnlUISSw50Mwz1ZME4kqF4rNF+JWFqs0kQ+oaJGJShw=
github.com/ctrf-io/go-ctrf-json-reporter v0.0.15/go.mod h1:36bVomyu0b70mpxgIQVllRXYyQFPSS+CeHZTn7zxYzQ=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk=
github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE=
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
Expand All @@ -21,29 +33,43 @@ github.com/jstemmer/go-junit-report/v2 v2.1.0 h1:X3+hPYlSczH9IMIpSC9CQSZA0L+BipY
github.com/jstemmer/go-junit-report/v2 v2.1.0/go.mod h1:mgHVr7VUo5Tn8OLVr1cKnLuEy0M92wdRntM99h7RkgQ=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ=
golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc=
golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ=
golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg=
golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s=
golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=
golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/gotestsum v1.13.0 h1:+Lh454O9mu9AMG1APV4o0y7oDYKyik/3kBOiCqiEpRo=
Expand Down
Loading
Loading