Skip to content

Commit 15c4d15

Browse files
authored
Merge pull request #207 from grafana/shared-workflows
Shared workflows
2 parents 62d3336 + 33379da commit 15c4d15

Some content is hidden

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

43 files changed

+1158
-805
lines changed

.devcontainer/devcontainer.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "xk6-dashboard",
3+
"image": "mcr.microsoft.com/devcontainers/base:1-bookworm",
4+
"customizations": {
5+
"vscode": {
6+
"settings": {
7+
"go.lintTool": "golangci-lint",
8+
"go.lintFlags": ["--fast"]
9+
},
10+
"extensions": [
11+
"EditorConfig.EditorConfig",
12+
"esbenp.prettier-vscode",
13+
"github.vscode-github-actions",
14+
"github.vscode-pull-request-github",
15+
"jetmartin.bats",
16+
"mads-hartmann.bash-ide-vscode",
17+
"foxundermoon.shell-format"
18+
]
19+
}
20+
},
21+
22+
"features": {
23+
"ghcr.io/devcontainers/features/github-cli:1": {},
24+
"ghcr.io/devcontainers/features/go:1": {
25+
"version": "1.24",
26+
"golangciLintVersion": "2.1.6"
27+
},
28+
"ghcr.io/devcontainers/features/node:1": { "version": "22" },
29+
"ghcr.io/guiyomh/features/goreleaser:0": { "version": "2.9.0" },
30+
"ghcr.io/michidk/devcontainers-features/bun:1": { "version": "1.2.12" },
31+
"ghcr.io/szkiba/devcontainer-features/gosec:1": { "version": "2.22.4" },
32+
"ghcr.io/szkiba/devcontainer-features/govulncheck:1": {
33+
"version": "1.1.4"
34+
},
35+
"ghcr.io/szkiba/devcontainer-features/cdo:1": { "version": "0.1.2" },
36+
"ghcr.io/szkiba/devcontainer-features/mdcode:1": { "version": "0.2.0" },
37+
"ghcr.io/szkiba/devcontainer-features/bats:1": { "version": "1.11.1" },
38+
"ghcr.io/grafana/devcontainer-features/xk6:1": { "version": "0.19.2" }
39+
},
40+
41+
"remoteEnv": {
42+
"GH_TOKEN": "${localEnv:GH_TOKEN}",
43+
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}",
44+
"XK6_EARLY_ACCESS": "true"
45+
}
46+
}

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = false
9+
insert_final_newline = true
10+
11+
[*.{js,ts,yml,yaml,json,sh,bats}]
12+
indent_size = 2
13+
trim_trailing_whitespace = true
14+
15+
[Makefile]
16+
indent_style = tab

.github/workflows/build.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/quality.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/release-cli.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1-
# SPDX-FileCopyrightText: 2023 Raintank, Inc. dba Grafana Labs
2-
#
3-
# SPDX-License-Identifier: AGPL-3.0-only
4-
51
name: release-cli
2+
3+
permissions: {}
4+
65
on:
76
push:
87
tags:
98
- "v*"
10-
permissions:
11-
contents: write
129

1310
jobs:
1411
release:
12+
permissions:
13+
contents: write
1514
runs-on: ubuntu-latest
1615
steps:
1716
- name: Checkout
1817
uses: actions/checkout@v4
1918
with:
2019
fetch-depth: 0
20+
persist-credentials: false
2121
- name: Set up Go
2222
uses: actions/setup-go@v5
2323
with:
24-
go-version: "1.21"
24+
go-version: ${{vars.GO_VERSION}}
25+
cache: false
2526
- name: Run GoReleaser
26-
uses: goreleaser/goreleaser-action@v6
27+
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
2728
with:
2829
distribution: goreleaser
29-
version: "1.22.0"
30+
version: "${{vars.GORELEASER_VERSION}}"
3031
args: release --clean
3132
env:
3233
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 12 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,20 @@
1-
# SPDX-FileCopyrightText: 2023 Iván Szkiba
2-
# SPDX-FileCopyrightText: 2023 Raintank, Inc. dba Grafana Labs
3-
#
4-
# SPDX-License-Identifier: AGPL-3.0-only
5-
# SPDX-License-Identifier: MIT
6-
71
name: Release
2+
3+
permissions: {}
4+
85
on:
96
push:
10-
tags:
11-
- "v*"
7+
tags: ["v*.*.*"]
128

139
jobs:
1410
release:
15-
name: Bundle xk6 extensions
16-
runs-on: ubuntu-latest
11+
name: Release
12+
uses: grafana/xk6/.github/workflows/[email protected]
1713
permissions:
1814
contents: write
19-
packages: write
20-
env:
21-
REGISTRY: ghcr.io
22-
IMAGE_NAME: ${{ github.repository }}
23-
24-
steps:
25-
- name: Check out code
26-
uses: actions/checkout@v4
27-
with:
28-
fetch-depth: 0
29-
30-
- name: Build
31-
id: build
32-
uses: szkiba/xk6bundler@v0
33-
with:
34-
with: github.com/grafana/xk6-dashboard=/github/workspace
35-
36-
- name: Create Release
37-
uses: softprops/action-gh-release@v2
38-
with:
39-
files: dist/*.tar.gz
40-
41-
- name: Log in to the Container registry
42-
uses: docker/login-action@v3
43-
with:
44-
registry: ${{ env.REGISTRY }}
45-
username: ${{ github.actor }}
46-
password: ${{ secrets.GITHUB_TOKEN }}
47-
48-
- name: Extract metadata (tags, labels) for Docker
49-
id: meta
50-
uses: docker/metadata-action@v5
51-
with:
52-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
53-
tags: |
54-
type=semver,pattern={{version}}
55-
type=semver,pattern={{major}}.{{minor}}
56-
type=semver,pattern={{major}}
57-
58-
- name: Build and push Docker image
59-
uses: docker/build-push-action@v6
60-
with:
61-
push: true
62-
context: ./${{ steps.build.outputs.dockerdir }}
63-
tags: ${{ steps.meta.outputs.tags }}
64-
labels: ${{ steps.meta.outputs.labels }}
15+
with:
16+
go-version: ${{vars.GO_VERSION}}
17+
k6-version: ${{vars.K6_VERSION}}
18+
xk6-version: ${{vars.XK6_VERSION}}
19+
os: ${{vars.OS}}
20+
arch: ${{vars.ARCH}}

.github/workflows/validate.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Validate
2+
3+
permissions: {}
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches: ["main", "master"]
9+
pull_request:
10+
branches: ["main", "master"]
11+
12+
jobs:
13+
validate:
14+
name: Validate
15+
uses: grafana/xk6/.github/workflows/[email protected]
16+
permissions:
17+
pages: write
18+
id-token: write
19+
with:
20+
go-version: ${{vars.GO_VERSION}}
21+
go-versions: ${{vars.GO_VERSIONS}}
22+
golangci-lint-version: ${{vars.GOLANGCI_LINT_VERSION}}
23+
platforms: ${{vars.PLATFORMS}}
24+
k6-versions: ${{vars.K6_VERSIONS}}
25+
xk6-version: ${{vars.XK6_VERSION}}

.github/zizmor.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
rules:
2+
unpinned-uses:
3+
config:
4+
policies:
5+
"*": hash-pin
6+
actions/*: any
7+
grafana/*: any
8+
forbidden-uses:
9+
config:
10+
deny:
11+
# Policy-banned by our security team due to CVE-2025-30066 & CVE-2025-30154.
12+
# https://www.cisa.gov/news-events/alerts/2025/03/18/supply-chain-compromise-third-party-tj-actionschanged-files-cve-2025-30066-and-reviewdogaction
13+
# https://nvd.nist.gov/vuln/detail/cve-2025-30066
14+
# https://nvd.nist.gov/vuln/detail/cve-2025-30154
15+
- reviewdog/*

.gitignore

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
# SPDX-FileCopyrightText: 2023 Iván Szkiba
2-
# SPDX-FileCopyrightText: 2023 Raintank, Inc. dba Grafana Labs
3-
#
4-
# SPDX-License-Identifier: AGPL-3.0-only
5-
# SPDX-License-Identifier: MIT
6-
71
/k6
82
/k6.exe
93
/k6-web-dashboard
104
/k6-web-dashboard.exe
115
/build
12-
/.bin
13-
/.hintrc
6+
/.hintrc
7+
/coverage.txt

0 commit comments

Comments
 (0)