Skip to content

Commit f4b96b0

Browse files
committed
introduce partial tyk pipeline
1 parent 9579411 commit f4b96b0

File tree

5 files changed

+404
-231
lines changed

5 files changed

+404
-231
lines changed

.github/workflows/ci-tests.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Run tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
env:
10+
TIMEOUT: 20m
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
if: ${{ !github.event.pull_request.draft }}
16+
steps:
17+
- name: "Checkout PR"
18+
uses: TykTechnologies/github-actions/.github/actions/checkout-pr@main
19+
with:
20+
token: ${{ secrets.ORG_GH_TOKEN }}
21+
22+
- name: "Get base ref"
23+
run: |
24+
git fetch origin ${{ env.BRANCH_NAME }}
25+
git rev-parse origin/${{ env.BRANCH_NAME }}
26+
27+
- name: Setup Golang
28+
uses: actions/setup-go@v5
29+
with:
30+
go-version-file: go.mod
31+
cache-dependency-path: go.sum
32+
33+
- name: golangci-lint
34+
uses: golangci/golangci-lint-action@v8
35+
timeout-minutes: 20
36+
with:
37+
version: v2.5.0
38+
only-new-issues: ${{ github.event_name == 'pull_request' }}
39+
# Output formats configured in .golangci.yml (v2 approach)
40+
# Generates: text to stdout + checkstyle JSON for SonarQube
41+
args: --issues-exit-code=0 -v ./...
42+
skip-cache: false
43+
skip-save-cache: false
44+
45+
- uses: actions/upload-artifact@v4
46+
if: ${{ always() }}
47+
with:
48+
name: golangcilint
49+
retention-days: 1
50+
path: |
51+
golangci-lint-report.json
52+
53+
unit-tests:
54+
runs-on: ubuntu-latest
55+
outputs:
56+
latest-version: ${{ steps.get-latest-version.outputs.version }}
57+
steps:
58+
- name: Checkout Code
59+
uses: actions/checkout@v4
60+
with:
61+
ref: ${{ github.event.pull_request.head.ref }}
62+
63+
- name: Setup Golang
64+
uses: actions/setup-go@v5
65+
with:
66+
go-version: 1.24.x
67+
68+
- name: Run unit tests
69+
env:
70+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
run: go test ./...

.github/workflows/go.yml

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

.github/workflows/shellcheck.yml

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

0 commit comments

Comments
 (0)