Skip to content

Commit 198112f

Browse files
committed
wush
1 parent 79f1e47 commit 198112f

File tree

3 files changed

+59
-129
lines changed

3 files changed

+59
-129
lines changed

.github/actions/setup-go/action.yaml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@ runs:
2020
with:
2121
go-version: ${{ inputs.version }}
2222
cache: ${{ inputs.cache }}
23-
- name: Install gotestsum and mtimehash
24-
shell: bash
25-
run: |
26-
export BUILD_CACHE_PATH=${{ inputs.build-cache-path }}
27-
if [ -n "${BUILD_CACHE_PATH}" ]; then
28-
mkdir -p "${BUILD_CACHE_PATH}"
29-
export GOCACHE="${BUILD_CACHE_PATH}/build"
30-
export GOMODCACHE="${BUILD_CACHE_PATH}/mod"
31-
fi
32-
go install gotest.tools/gotestsum@latest
33-
go install github.com/slsyy/mtimehash/cmd/mtimehash@latest
23+
# - name: Install gotestsum and mtimehash
24+
# shell: bash
25+
# run: |
26+
# export BUILD_CACHE_PATH=${{ inputs.build-cache-path }}
27+
# if [ -n "${BUILD_CACHE_PATH}" ]; then
28+
# mkdir -p "${BUILD_CACHE_PATH}"
29+
# export GOCACHE="${BUILD_CACHE_PATH}/build"
30+
# export GOMODCACHE="${BUILD_CACHE_PATH}/mod"
31+
# fi
32+
# go install gotest.tools/gotestsum@latest
33+
# go install github.com/slsyy/mtimehash/cmd/mtimehash@latest
3434

35-
# It isn't necessary that we ever do this, but it helps
36-
# separate the "setup" from the "run" times.
37-
- name: go mod download
38-
shell: bash
39-
run: |
40-
export BUILD_CACHE_PATH=${{ inputs.build-cache-path }}
41-
if [ -n "${BUILD_CACHE_PATH}" ]; then
42-
mkdir -p "${BUILD_CACHE_PATH}"
43-
export GOCACHE="${BUILD_CACHE_PATH}/build"
44-
export GOMODCACHE="${BUILD_CACHE_PATH}/mod"
45-
fi
46-
go mod download -x
35+
# # It isn't necessary that we ever do this, but it helps
36+
# # separate the "setup" from the "run" times.
37+
# - name: go mod download
38+
# shell: bash
39+
# run: |
40+
# export BUILD_CACHE_PATH=${{ inputs.build-cache-path }}
41+
# if [ -n "${BUILD_CACHE_PATH}" ]; then
42+
# mkdir -p "${BUILD_CACHE_PATH}"
43+
# export GOCACHE="${BUILD_CACHE_PATH}/build"
44+
# export GOMODCACHE="${BUILD_CACHE_PATH}/mod"
45+
# fi
46+
# go mod download -x

.github/actions/setup-imdisk/action.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "Setup ImDisk"
22
if: runner.os == 'Windows'
33
description: |
4-
Sets up the ImDisk toolkit for Windows and creates a RAM disk on drive R:.
4+
Sets up the ImDisk toolkit for Windows and backs often-used paths with RAM disks
55
runs:
66
using: "composite"
77
steps:
@@ -22,6 +22,27 @@ runs:
2222
install.bat /silent
2323
2424
- name: Create RAM Disk
25-
shell: cmd
25+
shell: bash
2626
run: |
2727
imdisk -a -s 4096M -m R: -p "/fs:ntfs /q /y"
28+
29+
# bash
30+
mkdir "$RUNNER_TEMP"_tmp
31+
cp -r "$RUNNER_TEMP"/. "$RUNNER_TEMP"_tmp
32+
rm -rf "$RUNNER_TEMP"/*
33+
imdisk -a -s 8192M -m "$RUNNER_TEMP" -p "/fs:ntfs /q /y"
34+
cp -r "$RUNNER_TEMP"_tmp/. "$RUNNER_TEMP"
35+
rm -rf "$RUNNER_TEMP"_tmp
36+
37+
cd "$RUNNER_TEMP"
38+
export GOCACHE="$(go env GOCACHE)"
39+
export GOMODCACHE="$(go env GOMODCACHE)"
40+
rm -rf "$GOCACHE"
41+
rm -rf "$GOMODCACHE"
42+
mkdir -p "$GOCACHE"
43+
mkdir -p "$GOMODCACHE"
44+
imdisk -a -s 8192M -m "$GOCACHE" -p "/fs:ntfs /q /y"
45+
imdisk -a -s 8192M -m "$GOMODCACHE" -p "/fs:ntfs /q /y"
46+
47+
rm -rf "$GITHUB_WORKSPACE"/*
48+
imdisk -a -s 2048M -m "$GITHUB_WORKSPACE" -p "/fs:ntfs /q /y"

.github/workflows/ci.yaml

Lines changed: 13 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -236,45 +236,6 @@ jobs:
236236
with:
237237
fetch-depth: 1
238238

239-
- name: Setup Node
240-
uses: ./.github/actions/setup-node
241-
242-
- name: Setup Go
243-
uses: ./.github/actions/setup-go
244-
245-
- name: Setup sqlc
246-
uses: ./.github/actions/setup-sqlc
247-
248-
- name: Setup Terraform
249-
uses: ./.github/actions/setup-tf
250-
251-
- name: go install tools
252-
uses: ./.github/actions/setup-go-tools
253-
254-
- name: Install Protoc
255-
run: |
256-
mkdir -p /tmp/proto
257-
pushd /tmp/proto
258-
curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip
259-
unzip protoc.zip
260-
cp -r ./bin/* /usr/local/bin
261-
cp -r ./include /usr/local/bin/include
262-
popd
263-
264-
- name: make gen
265-
run: |
266-
# Remove golden files to detect discrepancy in generated files.
267-
make clean/golden-files
268-
# Notifications require DB, we could start a DB instance here but
269-
# let's just restore for now.
270-
git checkout -- coderd/notifications/testdata/rendered-templates
271-
# no `-j` flag as `make` fails with:
272-
# coderd/rbac/object_gen.go:1:1: syntax error: package statement must be first
273-
make --output-sync -B gen
274-
275-
- name: Check for unstaged files
276-
run: ./scripts/check_unstaged.sh
277-
278239
fmt:
279240
needs: changes
280241
if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
@@ -316,7 +277,7 @@ jobs:
316277
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' && 'depot-windows-2022-16' || matrix.os }}
317278
needs: changes
318279
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
319-
timeout-minutes: 20
280+
timeout-minutes: 90
320281
strategy:
321282
fail-fast: false
322283
matrix:
@@ -326,88 +287,36 @@ jobs:
326287
- windows-2022
327288
steps:
328289
- name: Harden Runner
290+
if: runner.os == 'Linux'
329291
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
330292
with:
331293
egress-policy: audit
332294

333-
- name: Checkout
334-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
335-
with:
336-
fetch-depth: 1
337-
338295
# Sets up the ImDisk toolkit for Windows and creates a RAM disk on drive R:.
339296
- name: Setup ImDisk
340297
if: runner.os == 'Windows'
341-
uses: ./.github/actions/setup-imdisk
298+
uses: hugodutka/setup-imdisk@e6437cdfa0a7e110bc3f560da8c04b3c3fcc4135
342299

343-
- name: Download Go Build Cache
344-
id: download-go-build-cache
345-
uses: ./.github/actions/test-cache/download
346-
if: runner.os == 'Windows'
300+
- name: Checkout
301+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
347302
with:
348-
key-prefix: test-go-build-11-${{ runner.os }}-${{ runner.arch }}
349-
cache-path: "/r/.cache/go-cache"
303+
fetch-depth: 1
350304

351305
- name: Setup Go
352306
uses: ./.github/actions/setup-go
353307
with:
354-
build-cache-path: /r/.cache/go-cache
308+
version: ""
355309
cache: false
356310

357-
- name: Normalize File and Directory Timestamps
311+
- name: Wush
312+
if: always() && runner.os == 'Windows'
358313
shell: bash
359314
run: |
360-
find . -type f ! -path ./.git/\*\* | mtimehash
361-
find . -type d ! -path ./.git/\*\* -exec touch -t 200601010000 {} +
362-
363-
- name: Setup Terraform
364-
uses: ./.github/actions/setup-tf
365-
366-
- name: Download Test Cache
367-
id: download-cache
368-
uses: ./.github/actions/test-cache/download
369-
with:
370-
key-prefix: test-go-${{ runner.os }}-${{ runner.arch }}
371-
372-
# - name: Test with Mock Database
373-
# id: test
374-
# shell: bash
375-
# run: |
376-
# # if macOS, install google-chrome for scaletests. As another concern,
377-
# # should we really have this kind of external dependency requirement
378-
# # on standard CI?
379-
# if [ "${{ matrix.os }}" == "macos-latest" ]; then
380-
# brew install google-chrome
381-
# fi
382-
383-
# # By default Go will use the number of logical CPUs, which
384-
# # is a fine default.
385-
# PARALLEL_FLAG=""
386-
387-
# # macOS will output "The default interactive shell is now zsh"
388-
# # intermittently in CI...
389-
# if [ "${{ matrix.os }}" == "macos-latest" ]; then
390-
# touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
391-
# fi
392-
# export TS_DEBUG_DISCO=true
393-
# export GOCACHE=/r/.cache/go-cache/build
394-
# export GOMODCACHE=/r/.cache/go-cache/mod
395-
# echo "PATH: $PATH"
396-
# gotestsum --junitfile="gotests.xml" --jsonfile="gotests.json" \
397-
# --packages="./..." -- $PARALLEL_FLAG -short -failfast
398-
399-
- name: Upload Test Cache
400-
uses: ./.github/actions/test-cache/upload
401-
with:
402-
cache-key: ${{ steps.download-cache.outputs.cache-key }}
315+
curl -L -o wush.zip https://github.com/coder/wush/releases/download/v0.4.1/wush_0.4.1_windows_amd64.zip
316+
unzip -o wush.zip
403317
404-
- name: Upload Go Build Cache
405-
if: runner.os == 'Windows'
406-
uses: ./.github/actions/test-cache/upload
407-
with:
408-
cache-key: ${{ steps.download-go-build-cache.outputs.cache-key }}-${{ github.run_id }}-${{ github.run_attempt }}
409-
cache-path: "/r/.cache/go-cache"
410-
override-condition: "true"
318+
chmod +x wush.exe
319+
./wush.exe serve
411320
412321
# We don't run the full test-suite for Windows & MacOS, so we just run the CLI tests on every PR.
413322
# We run the test suite in test-go-pg, including CLI.

0 commit comments

Comments
 (0)