Skip to content

Commit 498763a

Browse files
committed
adapt for the nightly gauntlet
1 parent 754bbd6 commit 498763a

File tree

1 file changed

+4
-63
lines changed

1 file changed

+4
-63
lines changed

.github/workflows/nightly-gauntlet.yaml

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ jobs:
1414
test-go-pg:
1515
# make sure to adjust NUM_PARALLEL_PACKAGES and NUM_PARALLEL_TESTS below
1616
# when changing runner sizes
17-
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || matrix.os && 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 }}
18-
needs: changes
19-
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
17+
runs-on: ${{ 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 }}
2018
# This timeout must be greater than the timeout set by `go test` in
2119
# `make test-postgres` to ensure we receive a trace of running
2220
# goroutines. Setting this to the timeout +5m should work quite well
@@ -25,7 +23,6 @@ jobs:
2523
strategy:
2624
matrix:
2725
os:
28-
- ubuntu-latest
2926
- macos-latest
3027
- windows-2022
3128
steps:
@@ -55,36 +52,17 @@ jobs:
5552
with:
5653
fetch-depth: 1
5754

58-
- name: Setup Go Paths
59-
id: go-paths
60-
uses: ./.github/actions/setup-go-paths
61-
62-
- name: Download Go Build Cache
63-
id: download-go-build-cache
64-
uses: ./.github/actions/test-cache/download
65-
with:
66-
key-prefix: test-go-build-${{ runner.os }}-${{ runner.arch }}
67-
cache-path: ${{ steps.go-paths.outputs.cached-dirs }}
68-
6955
- name: Setup Go
7056
uses: ./.github/actions/setup-go
7157
with:
7258
# Runners have Go baked-in and Go will automatically
7359
# download the toolchain configured in go.mod, so we don't
7460
# need to reinstall it. It's faster on Windows runners.
7561
use-preinstalled-go: ${{ runner.os == 'Windows' }}
76-
# Cache is already downloaded above
77-
use-cache: false
7862

7963
- name: Setup Terraform
8064
uses: ./.github/actions/setup-tf
8165

82-
- name: Download Test Cache
83-
id: download-cache
84-
uses: ./.github/actions/test-cache/download
85-
with:
86-
key-prefix: test-go-pg-${{ runner.os }}-${{ runner.arch }}
87-
8866
- name: Setup Embedded Postgres Cache Paths
8967
id: embedded-pg-cache
9068
uses: ./.github/actions/setup-embedded-pg-cache-paths
@@ -96,15 +74,6 @@ jobs:
9674
key-prefix: embedded-pg-${{ runner.os }}-${{ runner.arch }}
9775
cache-path: ${{ steps.embedded-pg-cache.outputs.cached-dirs }}
9876

99-
- name: Normalize File and Directory Timestamps
100-
shell: bash
101-
# Normalize file modification timestamps so that go test can use the
102-
# cache from the previous CI run. See https://github.com/golang/go/issues/58571
103-
# for more details.
104-
run: |
105-
find . -type f ! -path ./.git/\*\* | mtimehash
106-
find . -type d ! -path ./.git/\*\* -exec touch -t 200601010000 {} +
107-
10877
- name: Test with PostgreSQL Database
10978
env:
11079
POSTGRES_VERSION: "13"
@@ -163,41 +132,13 @@ jobs:
163132
NUM_PARALLEL_TESTS=8
164133
fi
165134
166-
# by default, run tests with cache
167-
TESTCOUNT=""
168-
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
169-
# on main, run tests without cache
170-
TESTCOUNT="-count=1"
171-
fi
172-
173-
TEST_RETRIES="--rerun-fails=2 --rerun-fails-max-failures=50"
174-
if [ "${{ github.ref }}" == "refs/heads/hugodutka/disable-test-retries-on-main" ]; then
175-
# on main, run tests without retries
176-
TEST_RETRIES=""
177-
fi
178-
179-
mkdir -p "$RUNNER_TEMP/sym"
180-
source scripts/normalize_path.sh
181-
# terraform gets installed in a random directory, so we need to normalize
182-
# the path to the terraform binary or a bunch of cached tests will be
183-
# invalidated. See scripts/normalize_path.sh for more details.
184-
normalize_path_with_symlinks "$RUNNER_TEMP/sym" "$(dirname $(which terraform))"
135+
# run tests without cache
136+
TESTCOUNT="-count=1"
185137
186-
DB=ci gotestsum $TEST_RETRIES \
138+
DB=ci gotestsum \
187139
--format standard-quiet --packages "./..." \
188140
-- -timeout=20m -v -p $NUM_PARALLEL_PACKAGES -parallel=$NUM_PARALLEL_TESTS $TESTCOUNT
189141
190-
- name: Upload Go Build Cache
191-
uses: ./.github/actions/test-cache/upload
192-
with:
193-
cache-key: ${{ steps.download-go-build-cache.outputs.cache-key }}
194-
cache-path: ${{ steps.go-paths.outputs.cached-dirs }}
195-
196-
- name: Upload Test Cache
197-
uses: ./.github/actions/test-cache/upload
198-
with:
199-
cache-key: ${{ steps.download-cache.outputs.cache-key }}
200-
201142
- name: Upload Embedded Postgres Cache
202143
uses: ./.github/actions/embedded-pg-cache/upload
203144
# We only use the embedded Postgres cache on macOS and Windows runners.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy