Skip to content

Commit 9dd6c45

Browse files
committed
Merge branch 'main' into dependabot/npm_and_yarn/site/eslint-635cd46f43
2 parents 55857f9 + 92798e9 commit 9dd6c45

File tree

239 files changed

+10103
-3281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+10103
-3281
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Generated files
22
coderd/apidoc/docs.go linguist-generated=true
3+
docs/api/*.md linguist-generated=true
4+
docs/cli/*.md linguist-generated=true
35
coderd/apidoc/swagger.json linguist-generated=true
46
coderd/database/dump.sql linguist-generated=true
57
peerbroker/proto/*.go linguist-generated=true
@@ -9,3 +11,4 @@ provisionersdk/proto/*.go linguist-generated=true
911
*.tfstate.json linguist-generated=true
1012
*.tfstate.dot linguist-generated=true
1113
*.tfplan.dot linguist-generated=true
14+
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: "Setup Node"
22
description: |
33
Sets up the node environment for tests, builds, etc.
4+
inputs:
5+
directory:
6+
description: |
7+
The directory to run the setup in.
8+
required: false
9+
default: "site"
410
runs:
511
using: "composite"
612
steps:
@@ -10,8 +16,8 @@ runs:
1016
node-version: 16.20.1
1117
# See https://github.com/actions/setup-node#caching-global-packages-data
1218
cache: "yarn"
13-
cache-dependency-path: "site/yarn.lock"
19+
cache-dependency-path: ${{ inputs.directory }}/yarn.lock
1420
- name: Install node_modules
1521
shell: bash
1622
run: ../scripts/yarn_install.sh
17-
working-directory: site
23+
working-directory: ${{ inputs.directory }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Setup sqlc
2+
description: |
3+
Sets up the sqlc environment for tests, builds, etc.
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Setup sqlc
8+
uses: sqlc-dev/setup-sqlc@v3
9+
with:
10+
sqlc-version: "1.19.1"

.github/workflows/ci.yaml

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
ts: ${{ steps.filter.outputs.ts }}
3636
k8s: ${{ steps.filter.outputs.k8s }}
3737
ci: ${{ steps.filter.outputs.ci }}
38+
offlinedocs-only: ${{ steps.filter.outputs.offlinedocs_count == steps.filter.outputs.all_count }}
39+
offlinedocs: ${{ steps.filter.outputs.offlinedocs }}
3840
steps:
3941
- name: Checkout
4042
uses: actions/checkout@v3
@@ -85,7 +87,6 @@ jobs:
8587
ts:
8688
- "site/**"
8789
- "Makefile"
88-
- "offlinedocs/**"
8990
k8s:
9091
- "helm/**"
9192
- "scripts/Dockerfile"
@@ -94,11 +95,16 @@ jobs:
9495
ci:
9596
- ".github/actions/**"
9697
- ".github/workflows/ci.yaml"
98+
offlinedocs:
99+
- "offlinedocs/**"
100+
97101
- id: debug
98102
run: |
99103
echo "${{ toJSON(steps.filter )}}"
100104
101105
lint:
106+
needs: changes
107+
if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
102108
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
103109
steps:
104110
- name: Checkout
@@ -164,9 +170,7 @@ jobs:
164170
uses: ./.github/actions/setup-go
165171

166172
- name: Setup sqlc
167-
uses: sqlc-dev/setup-sqlc@v3
168-
with:
169-
sqlc-version: "1.19.1"
173+
uses: ./.github/actions/setup-sqlc
170174

171175
- name: go install tools
172176
run: |
@@ -196,6 +200,8 @@ jobs:
196200
run: ./scripts/check_unstaged.sh
197201

198202
fmt:
203+
needs: changes
204+
if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
199205
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
200206
timeout-minutes: 5
201207
steps:
@@ -592,9 +598,68 @@ jobs:
592598
projectToken: 695c25b6cb65
593599
workingDir: "./site"
594600

601+
offlinedocs:
602+
name: offlinedocs
603+
needs: changes
604+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
605+
if: needs.changes.outputs.offlinedocs == 'true' || needs.changes.outputs.ci == 'true'
606+
steps:
607+
- name: Checkout
608+
uses: actions/checkout@v3
609+
with:
610+
fetch-depth: 0
611+
612+
- name: Setup Node
613+
uses: ./.github/actions/setup-node
614+
with:
615+
directory: offlinedocs
616+
617+
- name: Setup Go
618+
uses: ./.github/actions/setup-go
619+
620+
- name: Install go tools
621+
run: |
622+
go install github.com/golang/mock/mockgen@v1.6.0
623+
624+
- name: Setup sqlc
625+
uses: sqlc-dev/setup-sqlc@v3
626+
with:
627+
sqlc-version: "1.19.1"
628+
629+
- name: Install dependencies
630+
run: |
631+
cd offlinedocs
632+
yarn
633+
# Install prettier globally
634+
prettier_version=$(jq -r '.devDependencies.prettier' < package.json)
635+
yarn global add "prettier@${prettier_version}"
636+
637+
- name: Format
638+
run: |
639+
cd offlinedocs
640+
yarn format:check
641+
642+
- name: Lint
643+
run: |
644+
cd offlinedocs
645+
yarn lint
646+
647+
- name: Build
648+
run: |
649+
version="$(./scripts/version.sh)"
650+
make -j build/coder_docs_"$version".tgz
651+
595652
required:
596653
runs-on: ubuntu-latest
597-
needs: [fmt, lint, gen, test-go, test-go-pg, test-go-race, test-js]
654+
needs:
655+
- fmt
656+
- lint
657+
- gen
658+
- test-go
659+
- test-go-pg
660+
- test-go-race
661+
- test-js
662+
- offlinedocs
598663
# Allow this job to run even if the needed jobs fail, are skipped or
599664
# cancelled.
600665
if: always()

.github/workflows/pr-cleanup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Cleanup PR
1+
name: Cleanup PR deployment and image
22
on:
33
pull_request:
44
types: [closed]

0 commit comments

Comments
 (0)