Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39d8641

Browse files
committed
Merge branch 'main' into mes/use-time-2
2 parents edb3d1e + 3ab3ef8 commit 39d8641

File tree

482 files changed

+23304
-6791
lines changed

Some content is hidden

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

482 files changed

+23304
-6791
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Generated files
22
agent/agentcontainers/acmock/acmock.go linguist-generated=true
33
agent/agentcontainers/dcspec/dcspec_gen.go linguist-generated=true
4+
agent/agentcontainers/testdata/devcontainercli/*/*.log linguist-generated=true
45
coderd/apidoc/docs.go linguist-generated=true
56
docs/reference/api/*.md linguist-generated=true
67
docs/reference/cli/*.md linguist-generated=true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Setup Go tools"
2+
description: |
3+
Set up tools for `make gen`, `offlinedocs` and Schmoder CI.
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: go install tools
8+
shell: bash
9+
run: |
10+
go install google.golang.org/protobuf/cmd/[email protected]
11+
go install storj.io/drpc/cmd/[email protected]
12+
go install golang.org/x/tools/cmd/[email protected]
13+
go install github.com/mikefarah/yq/[email protected]
14+
go install go.uber.org/mock/[email protected]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: |
44
inputs:
55
version:
66
description: "The Go version to use."
7-
default: "1.24.1"
7+
default: "1.24.2"
88
runs:
99
using: "composite"
1010
steps:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ runs:
77
- name: Install Terraform
88
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
99
with:
10-
terraform_version: 1.11.3
10+
terraform_version: 1.11.4
1111
terraform_wrapper: false
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "Download Test Cache"
2+
description: |
3+
Downloads the test cache and outputs today's cache key.
4+
A PR job can use a cache if it was created by its base branch, its current
5+
branch, or the default branch.
6+
https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
7+
outputs:
8+
cache-key:
9+
description: "Today's cache key"
10+
value: ${{ steps.vars.outputs.cache-key }}
11+
inputs:
12+
key-prefix:
13+
description: "Prefix for the cache key"
14+
required: true
15+
cache-path:
16+
description: "Path to the cache directory"
17+
required: true
18+
# This path is defined in testutil/cache.go
19+
default: "~/.cache/coderv2-test"
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Get date values and cache key
24+
id: vars
25+
shell: bash
26+
run: |
27+
export YEAR_MONTH=$(date +'%Y-%m')
28+
export PREV_YEAR_MONTH=$(date -d 'last month' +'%Y-%m')
29+
export DAY=$(date +'%d')
30+
echo "year-month=$YEAR_MONTH" >> $GITHUB_OUTPUT
31+
echo "prev-year-month=$PREV_YEAR_MONTH" >> $GITHUB_OUTPUT
32+
echo "cache-key=${{ inputs.key-prefix }}-${YEAR_MONTH}-${DAY}" >> $GITHUB_OUTPUT
33+
34+
# TODO: As a cost optimization, we could remove caches that are older than
35+
# a day or two. By default, depot keeps caches for 14 days, which isn't
36+
# necessary for the test cache.
37+
# https://depot.dev/docs/github-actions/overview#cache-retention-policy
38+
- name: Download test cache
39+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
40+
with:
41+
path: ${{ inputs.cache-path }}
42+
key: ${{ steps.vars.outputs.cache-key }}
43+
# > If there are multiple partial matches for a restore key, the action returns the most recently created cache.
44+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
45+
# The second restore key allows non-main branches to use the cache from the previous month.
46+
# This prevents PRs from rebuilding the cache on the first day of the month.
47+
# It also makes sure that once a month, the cache is fully reset.
48+
restore-keys: |
49+
${{ inputs.key-prefix }}-${{ steps.vars.outputs.year-month }}-
50+
${{ github.ref != 'refs/heads/main' && format('{0}-{1}-', inputs.key-prefix, steps.vars.outputs.prev-year-month) || '' }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Upload Test Cache"
2+
description: Uploads the test cache. Only works on the main branch.
3+
inputs:
4+
cache-key:
5+
description: "Cache key"
6+
required: true
7+
cache-path:
8+
description: "Path to the cache directory"
9+
required: true
10+
# This path is defined in testutil/cache.go
11+
default: "~/.cache/coderv2-test"
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Upload test cache
16+
if: ${{ github.ref == 'refs/heads/main' }}
17+
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
18+
with:
19+
path: ${{ inputs.cache-path }}
20+
key: ${{ inputs.cache-key }}

0 commit comments

Comments
 (0)