perf: use fmt.Fprintf to avoid unnecessary string+args + WriteString #7921
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Contribs | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
paths: | |
- contribs/** | |
workflow_dispatch: | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
programs: ${{ steps.set-matrix.outputs.programs }} | |
go-versions: ${{ steps.get-go-versions.outputs.go-versions }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: set-matrix | |
run: | | |
echo "::set-output name=programs::$(ls -d contribs/*/ | cut -d/ -f2 | jq -R -s -c 'split("\n")[:-1]')" | |
- id: get-go-versions | |
run: | | |
contribs_programs=$(ls -d contribs/*/ | cut -d/ -f2) | |
versions_map="{" | |
for p in $contribs_programs; do | |
# Fetch the go version of the contribs entry, and save it | |
# to a versions map we can reference later in the workflow | |
go_version=$(grep "^go [0-9]" contribs/$p/go.mod | cut -d ' ' -f2) | |
versions_map="$versions_map\"$p\":\"$go_version\"," | |
done | |
# Close out the JSON | |
versions_map="${versions_map%,}" | |
versions_map="$versions_map}" | |
echo "::set-output name=go-versions::$versions_map" | |
main: | |
needs: setup | |
strategy: | |
fail-fast: false | |
matrix: | |
program: ${{ fromJson(needs.setup.outputs.programs) }} | |
name: Run Main | |
uses: ./.github/workflows/main_template.yml | |
with: | |
modulepath: contribs/${{ matrix.program }} | |
go-version: ${{ (fromJson(needs.setup.outputs.go-versions))[matrix.program] }} | |
secrets: | |
codecov-token: ${{ secrets.CODECOV_TOKEN }} |