@@ -916,6 +916,7 @@ jobs:
916
916
-test-e2e
917
917
-offlinedocs
918
918
-sqlc-vet
919
+ -check-build
919
920
# Allow this job to run even if the needed jobs fail, are skipped or
920
921
# cancelled.
921
922
if :always()
@@ -936,6 +937,7 @@ jobs:
936
937
echo "- test-js: ${{ needs.test-js.result }}"
937
938
echo "- test-e2e: ${{ needs.test-e2e.result }}"
938
939
echo "- offlinedocs: ${{ needs.offlinedocs.result }}"
940
+ echo "- check-build: ${{ needs.check-build.result }}"
939
941
echo
940
942
941
943
# We allow skipped jobs to pass, but not failed or cancelled jobs.
@@ -1026,6 +1028,44 @@ jobs:
1026
1028
if :${{ github.repository_owner == 'coder' && github.ref == 'refs/heads/main' }}
1027
1029
run :rm -f /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
1028
1030
1031
+ check-build :
1032
+ # This job runs make build to verify compilation on PRs
1033
+ needs :changes
1034
+ if :needs.changes.outputs.go == 'true' && github.ref != 'refs/heads/main'
1035
+ runs-on :${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
1036
+ steps :
1037
+ -name :Harden Runner
1038
+ uses :step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
1039
+ with :
1040
+ egress-policy :audit
1041
+
1042
+ -name :Checkout
1043
+ uses :actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1044
+ with :
1045
+ fetch-depth :0
1046
+
1047
+ -name :Setup Node
1048
+ uses :./.github/actions/setup-node
1049
+
1050
+ -name :Setup Go
1051
+ uses :./.github/actions/setup-go
1052
+
1053
+ -name :Install go-winres
1054
+ run :go install github.com/tc-hib/go-winres@d743268d7ea168077ddd443c4240562d4f5e8c3e # v0.3.3
1055
+
1056
+ -name :Install nfpm
1057
+ run :go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.35.1
1058
+
1059
+ -name :Install zstd
1060
+ run :sudo apt-get install -y zstd
1061
+
1062
+ -name :Build
1063
+ run :|
1064
+ set -euxo pipefail
1065
+ go mod download
1066
+ make gen/mark-fresh
1067
+ make build
1068
+
1029
1069
build :
1030
1070
# This builds and publishes ghcr.io/coder/coder-preview:main for each commit
1031
1071
# to main branch.
@@ -1541,7 +1581,6 @@ jobs:
1541
1581
1542
1582
notify-slack-on-failure :
1543
1583
needs :
1544
- -build
1545
1584
-required
1546
1585
runs-on :ubuntu-latest
1547
1586
if :failure() && github.ref == 'refs/heads/main'