Skip to content

Commit c4de10e

Browse files
committed
Run CLI tests for Windows/MacOS on each PR
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent eb44197 commit c4de10e

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,65 @@ jobs:
378378
with:
379379
api-key: ${{ secrets.DATADOG_API_KEY }}
380380

381+
# We don't run the full test-suite for Windows & MacOS, so we just run the CLI tests on every PR.
382+
# We run the test suite in test-go-pg, including CLI.
383+
test-cli:
384+
runs-on: ${{ matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'depot-macos-latest' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-16-cores' || matrix.os }}
385+
needs: changes
386+
387+
388+
#TODO: reenable condition
389+
390+
391+
#if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
392+
strategy:
393+
matrix:
394+
os:
395+
- macos-latest
396+
- windows-2022
397+
steps:
398+
- name: Harden Runner
399+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
400+
with:
401+
egress-policy: audit
402+
403+
- name: Checkout
404+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
405+
with:
406+
fetch-depth: 1
407+
408+
- name: Setup Go
409+
uses: ./.github/actions/setup-go
410+
411+
- name: Setup Terraform
412+
uses: ./.github/actions/setup-tf
413+
414+
# Sets up the ImDisk toolkit for Windows and creates a RAM disk on drive R:.
415+
- name: Setup ImDisk
416+
if: runner.os == 'Windows'
417+
uses: ./.github/actions/setup-imdisk
418+
419+
- name: Test CLI
420+
env:
421+
TS_DEBUG_DISCO: "true"
422+
LC_CTYPE: "en_US.UTF-8"
423+
LC_ALL: "en_US.UTF-8"
424+
shell: bash
425+
run: |
426+
# By default Go will use the number of logical CPUs, which
427+
# is a fine default.
428+
PARALLEL_FLAG=""
429+
430+
make test-cli
431+
432+
- name: Upload test stats to Datadog
433+
timeout-minutes: 1
434+
continue-on-error: true
435+
uses: ./.github/actions/upload-datadog
436+
if: success() || failure()
437+
with:
438+
api-key: ${{ secrets.DATADOG_API_KEY }}
439+
381440
test-go-pg:
382441
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'depot-macos-latest' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-16-cores' || matrix.os }}
383442
needs: changes

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,10 @@ test:
807807
$(GIT_FLAGS) gotestsum --format standard-quiet -- -v -short -count=1 ./...
808808
.PHONY: test
809809

810+
test-cli:
811+
$(GIT_FLAGS) gotestsum --format standard-quiet -- -v -short -count=1 ./cli/...
812+
.PHONY: test-cli
813+
810814
# sqlc-cloud-is-setup will fail if no SQLc auth token is set. Use this as a
811815
# dependency for any sqlc-cloud related targets.
812816
sqlc-cloud-is-setup:

0 commit comments

Comments
 (0)