Skip to content

Commit 06dccd8

Browse files
authored
Update dev to v34 (#29)
* Update license exceptions for cargo-deny * Use just-cargo util, eliminating justfile boilerplate Signed-off-by: Oliver Gould <[email protected]>
1 parent a5d92cf commit 06dccd8

File tree

7 files changed

+69
-69
lines changed

7 files changed

+69
-69
lines changed

.devcontainer/devcontainer.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "k8s-gateway-api",
3-
"image": "ghcr.io/linkerd/dev:v32",
3+
"image": "ghcr.io/linkerd/dev:v34",
44
"extensions": [
55
"DavidAnson.vscode-markdownlint",
6+
"kokakiwi.vscode-just",
67
"NathanRidley.autotrim",
78
"rust-lang.rust-analyzer",
8-
"skellock.just",
99
"samverschueren.final-newline",
1010
"tamasfe.even-better-toml",
1111
],
@@ -20,6 +20,10 @@
2020
"overrideCommand": false,
2121
"remoteUser": "code",
2222
"mounts": [
23-
"source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
23+
{
24+
"source": "/var/run/docker.sock",
25+
"target": "/var/run/docker-host.sock",
26+
"type": "bind"
27+
}
2428
]
2529
}

.github/workflows/actions.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ jobs:
1313
actionlint:
1414
runs-on: ubuntu-20.04
1515
timeout-minutes: 10
16-
container: ghcr.io/linkerd/dev:v32-tools
16+
container: ghcr.io/linkerd/dev:v34-action
1717
steps:
1818
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
19-
- run: just action-lint
19+
- run: just-dev lint-actions
2020

2121
devcontainer-versions:
2222
runs-on: ubuntu-latest
23-
container: ghcr.io/linkerd/dev:v32-tools
23+
container: ghcr.io/linkerd/dev:v34-action
2424
steps:
2525
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
26-
- run: just action-dev-check
26+
- run: just-dev check-action-images

.github/workflows/integration.yml

+21-7
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,46 @@ env:
1515
CARGO_NET_RETRY: 10
1616
RUSTUP_MAX_RETRIES: 10
1717
RUST_VERSION: 1.64.0
18-
K3D_VERSION: v5.4.4
18+
K3D_VERSION: v5.4.6
19+
K3D_CREATE_FLAGS: '--no-lb'
20+
K3S_DISABLE: 'local-storage,traefik,servicelb,metrics-server@server:*'
21+
NEXTEST_VERSION: '0.9.42'
1922

2023
jobs:
2124
test:
2225
strategy:
2326
matrix:
2427
k8s:
2528
- v1.21
26-
- v1.24
27-
timeout-minutes: 5
29+
- v1.25
30+
timeout-minutes: 10
2831
runs-on: ubuntu-latest
2932
steps:
33+
# TODO(ver) Figure out how to use tools from the dev image.
3034
- name: Install rust
3135
run: |
3236
rm -rf "$HOME/.cargo"
3337
curl --proto =https --tlsv1.3 -fLsSv https://sh.rustup.rs | sh -s -- -y --default-toolchain "${RUST_VERSION}"
3438
source "$HOME/.cargo/env"
3539
echo "PATH=$PATH" >> "$GITHUB_ENV"
3640
cargo version
41+
- name: Install cargo-nextest
42+
run: |
43+
url="https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-${NEXTEST_VERSION}/cargo-nextest-${NEXTEST_VERSION}-x86_64-unknown-linux-gnu.tar.gz" ; \
44+
curl --proto =https --tlsv1.3 -LsSv "$url" | tar zvxf - -C /usr/local/bin cargo-nextest
45+
- name: Install dev utils
46+
run: |
47+
sha=574d6bab940a5fcfcd49169cd0b24ee72e2b5a04 # dev:v34
48+
cd /usr/local/bin
49+
for util in cargo k3d ; do
50+
curl --proto =https --tlsv1.3 -fLsSvO "https://raw.githubusercontent.com/linkerd/dev/$sha/bin/just-$util"
51+
chmod 755 "/usr/local/bin/just-$util"
52+
done
53+
- uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76
3754
# Setup a cluster
3855
- run: curl --proto =https --tlsv1.3 -fLsSv "https://raw.githubusercontent.com/k3d-io/k3d/${K3D_VERSION}/install.sh" | bash
3956
- run: k3d --version
40-
- run: k3d cluster create --no-lb --k3s-arg '--no-deploy=local-storage,traefik,servicelb,metrics-server@server:*' --image +${{ matrix.k8s }}
57+
- run: just-k3d K8S_VERSION=${{ matrix.k8s }} create
4158
- run: kubectl version
4259
# Install CRDs
4360
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
@@ -46,11 +63,8 @@ jobs:
4663
ref: 4f86f0bd65173b04dadb558f63fbbd53330736d2 # 0.5.0-rc1
4764
path: gateway-api
4865
- run: kubectl apply -k gateway-api/config/crd/experimental/
49-
# Setup just
50-
- uses: extractions/setup-just@95b912dc5d3ed106a72907f2f9b91e76d60bdb76
5166
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
5267
# Run tests
5368
- run: just fetch
5469
- run: just test-build --package=integration
5570
- run: just test --package=integration
56-

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
lint:
2020
timeout-minutes: 5
2121
runs-on: ubuntu-latest
22-
container: docker://ghcr.io/linkerd/dev:v32-rust
22+
container: docker://ghcr.io/linkerd/dev:v34-rust
2323
steps:
2424
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
2525
- run: just fetch

.github/workflows/release.yml

+15-11
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ jobs:
2626
run: |
2727
ref=${{ github.ref }}
2828
if [[ "$ref" == refs/tags/release/* ]]; then
29-
echo ::set-output name=publish::true
30-
echo ::set-output name=version::"${ref##refs/tags/release/}"
29+
( echo version="${ref##refs/tags/release/}"
30+
echo publish=true
31+
) >> "$GITHUB_OUTPUT"
3132
else
3233
sha=${{ github.sha }}
33-
echo ::set-output name=version::"test-${sha:0:7}"
34+
( echo version="test-${sha:0:7}"
35+
) >> "$GITHUB_OUTPUT"
3436
fi
3537
outputs:
3638
publish: ${{ steps.meta.outputs.publish }}
@@ -39,7 +41,7 @@ jobs:
3941
test:
4042
timeout-minutes: 5
4143
runs-on: ubuntu-latest
42-
container: docker://ghcr.io/linkerd/dev:v32-rust
44+
container: docker://ghcr.io/linkerd/dev:v34-rust
4345
steps:
4446
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
4547
- run: just fetch
@@ -53,17 +55,18 @@ jobs:
5355
contents: write
5456
timeout-minutes: 5
5557
runs-on: ubuntu-latest
56-
container: docker://ghcr.io/linkerd/dev:v32-rust
58+
container: docker://ghcr.io/linkerd/dev:v34-rust
5759
steps:
5860
- if: needs.meta.outputs.publish
5961
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
6062
- if: needs.meta.outputs.publish
6163
shell: bash
6264
run: |
63-
version=$(cargo metadata --format-version=1 | jq -r '.packages[] | select(.name == "k8s-gateway-api") | .version')
65+
just-cargo fetch
66+
crate=$(just-cargo crate-version k8s-gateway-api)
6467
tag="${{ needs.meta.outputs.version }}"
65-
if [[ "v${version}" != "$tag" ]]; then
66-
echo "::error ::Crate version v${version} does not match tag ${tag}"
68+
if [[ "$crate" != "$tag" ]]; then
69+
echo "::error ::Crate version ${crate} does not match tag ${tag}"
6770
exit 1
6871
fi
6972
- if: needs.meta.outputs.publish
@@ -77,9 +80,10 @@ jobs:
7780
needs: [meta, release]
7881
timeout-minutes: 10
7982
runs-on: ubuntu-latest
80-
container: docker://ghcr.io/linkerd/dev:v32-rust
83+
container: docker://ghcr.io/linkerd/dev:v34-rust
8184
steps:
8285
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
83-
- run: just publish --dry-run
84-
- if: needs.meta.outputs.publish
86+
- if: needs.meta.outputs.publish == ''
87+
run: just publish --dry-run
88+
- if: needs.meta.outputs.publish == 'true'
8589
run: just publish --token=${{ secrets.CRATESIO_TOKEN }}

deny.toml

+9-5
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ ignore = []
1515

1616
[licenses]
1717
unlicensed = "deny"
18-
allow = [
19-
"Apache-2.0",
20-
"MIT",
21-
]
18+
allow = ["Apache-2.0", "BSD-3-Clause", "MIT"]
2219
deny = []
2320
copyleft = "deny"
2421
allow-osi-fsf-free = "neither"
2522
default = "deny"
2623
confidence-threshold = 0.8
27-
exceptions = []
24+
25+
[[licenses.exceptions]]
26+
# The Unicode-DFS-2016 license is necessary for unicode-ident because they
27+
# use data from the unicode tables to generate the tables which are
28+
# included in the application. We do not distribute those data files so
29+
# this is not a problem for us. See https://github.com/dtolnay/unicode-ident/pull/9/files
30+
name = "unicode-ident"
31+
allow = ["Unicode-DFS-2016"]
2832

2933
[bans]
3034
multiple-versions = "deny"

justfile

+12-38
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,40 @@
33
export RUST_BACKTRACE := env_var_or_default("RUST_BACKTRACE", "short")
44
export RUSTFLAGS := env_var_or_default("RUSTFLAGS", "-D warnings -A deprecated")
55

6-
toolchain := ""
7-
cargo := "cargo" + if toolchain != "" { " +" + toolchain } else { "" }
8-
9-
# If we're running in Github Actions and cargo-action-fmt is installed, then add
10-
# a command suffix that formats errors.
11-
_fmt := if env_var_or_default("GITHUB_ACTIONS", "") != "true" { "" } else {
12-
```
13-
if command -v cargo-action-fmt >/dev/null 2>&1; then
14-
echo "--message-format=json | cargo-action-fmt"
15-
fi
16-
```
17-
}
18-
196
default: fetch deny lint test-build test
207

218
lint: check-fmt clippy docs md-lint action-lint action-dev-check
229

2310
md-lint:
24-
markdownlint-cli2 '**/*.md' '!**/node_modules' '!**/target'
11+
markdownlint-cli2 '**/*.md' '!**/target'
2512

2613
fetch:
27-
{{ cargo }} fetch
14+
just-cargo fetch
2815

2916
check-fmt:
30-
{{ cargo }} fmt -- --check
17+
just-cargo fmt -- --check
3118

3219
clippy:
33-
{{ cargo }} clippy --frozen --workspace --all-targets --all-features {{ _fmt }}
20+
just-cargo clippy --frozen --workspace --all-targets --all-features
3421

3522
deny:
36-
{{ cargo }} deny --all-features check
23+
cargo-deny --all-features check
3724

3825
docs:
39-
{{ cargo }} doc --frozen --no-deps --features=k8s-openapi/v1_24 {{ _fmt }}
26+
just-cargo doc --frozen --no-deps --features=k8s-openapi/v1_25
4027

4128
test-build *flags:
42-
{{ cargo }} test --no-run --frozen {{ flags }} {{ _fmt }}
29+
just-cargo test-build --frozen {{ flags }}
4330

4431
test *flags:
45-
{{ cargo }} test --frozen {{ flags }}
32+
just-cargo test --frozen {{ flags }}
4633

4734
publish *flags:
48-
{{ cargo }} publish --features=k8s-openapi/v1_24 {{ flags }}
49-
35+
cargo publish --features=k8s-openapi/v1_25 {{ flags }}
5036

51-
##
52-
## GitHub Actions
53-
##
54-
55-
# Format actionlint output for Github Actions if running in CI.
56-
_actionlint-fmt := if env_var_or_default("GITHUB_ACTIONS", "") != "true" { "" } else {
57-
'{{range $err := .}}::error file={{$err.Filepath}},line={{$err.Line}},col={{$err.Column}}::{{$err.Message}}%0A```%0A{{replace $err.Snippet "\\n" "%0A"}}%0A```\n{{end}}'
58-
}
59-
60-
# Lints all GitHub Actions workflows
6137
action-lint:
62-
actionlint {{ if _actionlint-fmt != '' { "-format '" + _actionlint-fmt + "'" } else { "" } }} .github/workflows/*
38+
just-dev lint-actions
6339

64-
# Ensure all devcontainer versions are in sync
6540
action-dev-check:
66-
action-dev-check
67-
68-
# vim: set ft=make :
41+
just-dev check-action-images
42+
just-dev pull-action-images

0 commit comments

Comments
 (0)