From 1c235c61cab5718717ebf098a18c7bd52f6cbf65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Thu, 28 Nov 2024 06:56:57 +0100 Subject: [PATCH] ci: use Validate workflow from grafana/k6-extension-workflows --- .github/workflows/docs.yml | 44 ---------------------- .github/workflows/lint.yml | 32 ---------------- .github/workflows/test.yml | 68 ---------------------------------- .github/workflows/validate.yml | 13 +++++++ 4 files changed, 13 insertions(+), 144 deletions(-) delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/test.yml create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 125a6f8..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Docs -on: - workflow_dispatch: - push: - branches: [main] - paths: - - .github/workflows/docs.yml - - index.d.ts - - tsconfig.json - -jobs: - docs: - name: Docs - runs-on: ubuntu-latest - permissions: - pages: write - id-token: write - - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install bun - uses: oven-sh/setup-bun@v2 - - - name: Install dependencies - run: bun install - - - name: Generate API doc - run: bun x typedoc - - name: Copy index.d.ts - run: cp index.d.ts build/docs/ - - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: "build/docs" - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index d745a46..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Lint - -on: - push: - pull_request: - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: 1.22.x - - name: Check module dependencies - run: | - go version - test -z "$(go mod tidy && git status go.* --porcelain)" - go mod verify - - name: Retrieve golangci-lint version - run: | - echo "Version=$(head -n 1 .golangci.yml | tr -d '# ')" >> $GITHUB_OUTPUT - id: version - - name: golangci-lint - uses: golangci/golangci-lint-action@v6 - with: - version: ${{ steps.version.outputs.Version }} - only-new-issues: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 779064c..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Test - -on: - workflow_dispatch: - push: - branches: - - main - tags: - - v* - pull_request: - -jobs: - coverage: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: 1.22.x - - name: Build - run: | - go version - pwd && ls -l - - go install go.k6.io/xk6/cmd/xk6@latest - MODULE_NAME=$(go list -m) - - xk6 build \ - --output ./k6ext \ - --with $MODULE_NAME="." - ./k6ext version - - - name: Test - if: ${{ github.ref_name == 'main' }} - run: go test -count 1 -coverprofile=coverage.txt ./... - - - name: Upload Coverage - if: ${{ github.ref_name == 'main' }} - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - slug: grafana/xk6-sql - - - name: Generate Go Report Card - if: ${{ github.ref_name == 'main' }} - uses: creekorful/goreportcard-action@v1.0 - - test: - strategy: - fail-fast: false - matrix: - go-version: [1.22.x, 1.21.x] - platform: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.platform }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install Go ${{ matrix.go-version }} - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go-version }} - - name: Run tests - run: | - which go - go version - go test -race -timeout 60s ./... diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..56d12ee --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,13 @@ +name: Validate + +on: + workflow_dispatch: + push: + branches: ["main", "master"] + pull_request: + branches: ["main", "master"] + +jobs: + validate: + name: Validate + uses: grafana/k6-extension-workflows/.github/workflows/validate.yml@v0.1.0