-
Notifications
You must be signed in to change notification settings - Fork 91
127 lines (123 loc) · 4.85 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: pull_request
jobs:
test-plugins:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.2'
bundler-cache: true
- working-directory: jekyll-kuma-plugins
run: bundle install
- working-directory: jekyll-kuma-plugins
run: bundle exec rspec
check-links:
name: Check links
runs-on: ubuntu-latest
env:
URL: https://deploy-preview-${{github.event.number}}--kuma.netlify.app
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/setup-go@v4
- run: |
go install github.com/raviqqe/muffet/[email protected]
- name: Wait for Pages changed to be neutral
uses: fountainhead/[email protected]
id: waitForCheck
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
checkName: "Pages changed - kuma"
timeoutSeconds: 1200
- name: Wait for Netlify site to be ready
if: steps.waitForCheck.outputs.conclusion == 'neutral'
uses: jakepartusch/[email protected]
id: waitForNetlify
with:
site_name: "kuma"
max_timeout: 1200
- name: link checker
run: |
$(go env GOPATH)/bin/muffet ${URL} --buffer-size 8192 --exclude https://linux.die.net --exclude https://twitter.com --max-connections-per-host=8 --exclude 127.0.0.1 --exclude 'https://github.com/kumahq/kuma/pull' --exclude 'https://github.com//kumahq/kuma/pull' --exclude 'https://github.com/spiffe/spiffe/blob/main/standards/X509-SVID.md.*' --exclude https://download.konghq.com --exclude ${URL}/docs/1. --rate-limit 50 --timeout 60
- name: link checker dev docs
run: |
$(go env GOPATH)/bin/muffet ${URL}/docs/dev --buffer-size 8192 --exclude https://linux.die.net --exclude https://twitter.com --max-connections-per-host=8 --exclude 127.0.0.1 --exclude 'https://github.com/kumahq/kuma/pull' --exclude 'https://github.com//kumahq/kuma/pull' --exclude 'https://github.com/spiffe/spiffe/blob/main/standards/X509-SVID.md.*' --exclude https://download.konghq.com --rate-limit 50 --timeout 60
installer-sh:
name: Test installer.sh
runs-on: ubuntu-latest
strategy:
matrix:
# NOTE: for each new OS, the check must be explicitly set as required in Github
os:
- amazonlinux:2022
- debian:bookworm
- redhat/ubi8:8.6
- ubuntu:22.04
- archlinux:latest
- fedora:latest
container:
image: ${{ matrix.os }}
steps:
- name: Prepare OS
run: |
(apt-get update && apt-get install file curl -y) || true
yum install file tar gzip -y || true
- uses: actions/checkout@v3
- name: Run installer.sh
run: sh app/installer.sh
- name: Check kumactl architecture
run: file ./kuma-*/bin/kumactl | grep x86-64 &> /dev/null
installer-sh-arm64:
runs-on: ubuntu-latest
name: Test installer.sh on arm64
steps:
- uses: actions/checkout@v3
- uses: uraimo/run-on-arch-action@v2
name: Run commands
id: runcmd
with:
arch: aarch64
distro: ubuntu22.04
# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}
# Set an output parameter `uname` for use in subsequent steps
run: |
apt-get update && apt-get install -y file curl tar gzip
sh app/installer.sh
file ./kuma-*/bin/kumactl | grep aarch64 &> /dev/null
vale:
name: Lint docs
runs-on: ubuntu-latest
steps:
- name: Get changed files
id: changed-files
uses: actions/github-script@v6
with:
script: |
// Note that we filter here first because otherwise vale is run on all files
// before the output is filtered to changed files, which takes a long time.
const files = await github.paginate(
github.rest.pulls.listFiles, {
...context.repo,
pull_number: ${{ github.event.number }},
},
);
return files
.filter(d => d.status != "removed")
.filter(d => !d.filename.includes("/generated/"))
.filter(d => !d.filename.includes("/raw/"))
.map(d => d.filename);
- uses: actions/checkout@v2
- uses: errata-ai/vale-action@v2
if: join(fromJSON(steps.changed-files.outputs.result)) != ''
name: Run Vale
with:
files: "${{ steps.changed-files.outputs.result }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}