From 0329743925f945e3814edc8963692de7cd27d752 Mon Sep 17 00:00:00 2001 From: Carson Long <12767276+ctlong@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:37:05 -0800 Subject: [PATCH 1/2] CI: Add GH actions workflow --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..417a94ed1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: [ "develop", "release-candidate", "main" ] + pull_request: + branches: [ "develop", "release-candidate", "main" ] + schedule: + - cron: '00 7 * * 1' + +jobs: + unit-test: + name: Unit Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + - name: Run ginkgo tests + run: go run github.com/onsi/ginkgo/v2/ginkgo -r --procs=3 --compilers=3 --randomize-all --randomize-suites --fail-on-pending --keep-going --race --trace helpers + + check-pr-target-branch: + if: github.event_name == 'pull_request' + name: Check PR target branch + runs-on: ubuntu-latest + steps: + - name: Fail if target branch is main + run: | + if [ "${{ github.event.pull_request.base.ref }}" == "main" ]; then + echo "Pull requests should not target 'main' branch." + exit 1 + fi + - name: Fail if target branch is release-candidate + run: | + if [ "${{ github.event.pull_request.base.ref }}" == "release-candidate" ]; then + echo "Pull requests should not target 'release-candidate' branch." + exit 1 + fi From 3b61940490f33e1f800264aaa6d49840b5b3785b Mon Sep 17 00:00:00 2001 From: Carson Long <12767276+ctlong@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:58:05 -0800 Subject: [PATCH 2/2] CI: Remove schedule from CI workflow Removes the unnecessary schedule from the GH Actions CI workflow. The schedule is unnecessary because there's currently no external dependency in any of the jobs in the workflow that could benefit from testing over time, without code changes. For example, that usually takes the form of a linting job, where the linting tool improves over time. --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 417a94ed1..f10603fbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,8 +5,6 @@ on: branches: [ "develop", "release-candidate", "main" ] pull_request: branches: [ "develop", "release-candidate", "main" ] - schedule: - - cron: '00 7 * * 1' jobs: unit-test: