open-consul/.github/workflows/reusable-check-go-mod.yml

40 lines
1.2 KiB
YAML
Raw Normal View History

Github Actions Migration - move go-tests workflows to GHA (#16761) * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * making on pull_request * Update .github/scripts/rerun_fails_report.sh Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * make runs-on required * removing go-version param that is not used. * removing go-version param that is not used. * Modify build-distros to use medium runners (#16773) * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * trying mediums * adding in script * fixing runs-on to be parameter * fixing merge conflict * changing to on push * removing whitespace * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * changing back to on pull_request --------- Co-authored-by: Dan Bond <danbond@protonmail.com> * Github Actions Migration - move verify-ci workflows to GHA (#16777) * add verify-ci workflow * adding comment and changing to on pull request. * changing to pull_requests * changing to pull_request * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * [NET-3029] Migrate frontend to GHA (#16731) * changing set up to a small * using consuls own custom runner pool. --------- Co-authored-by: Dan Bond <danbond@protonmail.com>
2023-03-28 21:29:27 +00:00
name: check-go-mod
on:
workflow_call:
inputs:
runs-on:
description: An expression indicating which kind of runners to use.
required: true
type: string
repository-name:
required: true
type: string
secrets:
elevated-github-token:
required: true
Github Actions Migration - move go-tests workflows to GHA (#16761) * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * making on pull_request * Update .github/scripts/rerun_fails_report.sh Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * make runs-on required * removing go-version param that is not used. * removing go-version param that is not used. * Modify build-distros to use medium runners (#16773) * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * trying mediums * adding in script * fixing runs-on to be parameter * fixing merge conflict * changing to on push * removing whitespace * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * changing back to on pull_request --------- Co-authored-by: Dan Bond <danbond@protonmail.com> * Github Actions Migration - move verify-ci workflows to GHA (#16777) * add verify-ci workflow * adding comment and changing to on pull request. * changing to pull_requests * changing to pull_request * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * [NET-3029] Migrate frontend to GHA (#16731) * changing set up to a small * using consuls own custom runner pool. --------- Co-authored-by: Dan Bond <danbond@protonmail.com>
2023-03-28 21:29:27 +00:00
jobs:
check-go-mod:
runs-on: ${{ fromJSON(inputs.runs-on) }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # pin@v3.3.0
# NOTE: This step is specifically needed for ENT. It allows us to access the required private HashiCorp repos.
- name: Setup Git
if: ${{ endsWith(inputs.repository-name, '-enterprise') }}
run: git config --global url."https://${{ secrets.elevated-github-token }}:@github.com".insteadOf "https://github.com"
Github Actions Migration - move go-tests workflows to GHA (#16761) * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * making on pull_request * Update .github/scripts/rerun_fails_report.sh Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * make runs-on required * removing go-version param that is not used. * removing go-version param that is not used. * Modify build-distros to use medium runners (#16773) * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * trying mediums * adding in script * fixing runs-on to be parameter * fixing merge conflict * changing to on push * removing whitespace * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * changing back to on pull_request --------- Co-authored-by: Dan Bond <danbond@protonmail.com> * Github Actions Migration - move verify-ci workflows to GHA (#16777) * add verify-ci workflow * adding comment and changing to on pull request. * changing to pull_requests * changing to pull_request * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * [NET-3029] Migrate frontend to GHA (#16731) * changing set up to a small * using consuls own custom runner pool. --------- Co-authored-by: Dan Bond <danbond@protonmail.com>
2023-03-28 21:29:27 +00:00
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # pin@v3.5.0
with:
go-version-file: 'go.mod'
# Run on all go.mod (include submodules).
- run: make go-mod-tidy
Github Actions Migration - move go-tests workflows to GHA (#16761) * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * making on pull_request * Update .github/scripts/rerun_fails_report.sh Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * make runs-on required * removing go-version param that is not used. * removing go-version param that is not used. * Modify build-distros to use medium runners (#16773) * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * trying mediums * adding in script * fixing runs-on to be parameter * fixing merge conflict * changing to on push * removing whitespace * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * changing back to on pull_request --------- Co-authored-by: Dan Bond <danbond@protonmail.com> * Github Actions Migration - move verify-ci workflows to GHA (#16777) * add verify-ci workflow * adding comment and changing to on pull request. * changing to pull_requests * changing to pull_request * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * [NET-3029] Migrate frontend to GHA (#16731) * changing set up to a small * using consuls own custom runner pool. --------- Co-authored-by: Dan Bond <danbond@protonmail.com>
2023-03-28 21:29:27 +00:00
- run: |
if [[ -n $(git status -s) ]]; then
echo "Git directory has changes"
git status -s
exit 1
fi
- name: Notify Slack
if: ${{ failure() }}
Github Actions Migration - move go-tests workflows to GHA (#16761) * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * making on pull_request * Update .github/scripts/rerun_fails_report.sh Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * make runs-on required * removing go-version param that is not used. * removing go-version param that is not used. * Modify build-distros to use medium runners (#16773) * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * trying mediums * adding in script * fixing runs-on to be parameter * fixing merge conflict * changing to on push * removing whitespace * go-tests workflow * add test splitting to go-tests * fix re-reun fails report path * fix re-reun fails report path another place * fixing tests for32bit and race * use script file to generate runners * fixing run path * add checkout * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * passing runs-on * setting up runs-on as a parameter to check-go-mod * changing back to on pull_request --------- Co-authored-by: Dan Bond <danbond@protonmail.com> * Github Actions Migration - move verify-ci workflows to GHA (#16777) * add verify-ci workflow * adding comment and changing to on pull request. * changing to pull_requests * changing to pull_request * Apply suggestions from code review Co-authored-by: Dan Bond <danbond@protonmail.com> * [NET-3029] Migrate frontend to GHA (#16731) * changing set up to a small * using consuls own custom runner pool. --------- Co-authored-by: Dan Bond <danbond@protonmail.com>
2023-03-28 21:29:27 +00:00
run: .github/scripts/notify_slack.sh