-
Notifications
You must be signed in to change notification settings - Fork 15
135 lines (110 loc) · 4.32 KB
/
test-docs.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
128
129
130
131
132
133
134
135
name: Run doc tests
on:
pull_request:
types: [opened, reopened, synchronize]
paths-ignore:
- '**/docs/**'
jobs:
setup:
runs-on: ubuntu-latest
outputs:
data-transforms-flatten: ${{ steps.filter.outputs.data-transforms-flatten }}
data-transforms-iss: ${{ steps.filter.outputs.data-transforms-iss }}
data-transforms-redaction: ${{ steps.filter.outputs.data-transforms-redaction }}
data-transforms-regex: ${{ steps.filter.outputs.data-transforms-regex }}
data-transforms-jq: ${{ steps.filter.outputs.data-transforms-jq }}
data-transforms-ts-converter: ${{ steps.filter.outputs.data-transforms-ts-converter }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Determine changed paths
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
data-transforms-flatten:
- 'data-transforms/flatten/**'
data-transforms-iss:
- 'data-transforms/iss_demo/**'
data-transforms-redaction:
- 'data-transforms/redaction/**'
data-transforms-regex:
- 'data-transforms/regex/**'
data-transforms-jq:
- 'data-transforms/jq/**'
data-transforms-ts-converter:
- 'data-transforms/ts-converter/**'
run-tests:
needs: setup
strategy:
fail-fast: false # Ensure all matrix jobs run to completion even if one fails
matrix:
os: [ubuntu-latest] # Only using Linux for now since macOS takes a long time
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: '21'
- name: Install dependencies
run: npm install
- name: Install tools on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
#!/bin/bash
set -e
FILENAME="rpk-linux-amd64.zip"
URL_BASE="https://github.com/redpanda-data/redpanda/releases"
# Download the latest version of rpk
echo "Downloading ${FILENAME}..."
curl -LO "${URL_BASE}/latest/download/${FILENAME}"
# Ensure the unzip command is available
sudo apt-get update && sudo apt-get install -y unzip expect jq
# Unzip the rpk binary to the target directory
unzip -o "${FILENAME}" -d $HOME/.local/bin
# Remove the downloaded archive
rm "${FILENAME}"
# Add the target directory to PATH
echo "$HOME/.local/bin" >> $GITHUB_PATH
# Verify installation
echo "rpk has been installed. Version information:"
rpk version
- name: Install tools on macOS
if: matrix.os == 'macos-13'
run: |
#!/bin/bash
set -e
# Install rpk using brew
brew install redpanda-data/tap/redpanda
# Verify installation
echo "rpk has been installed. Version information:"
rpk version
- name: Setup Docker on macOS
if: matrix.os == 'macos-13'
uses: douglascamata/setup-docker-macos-action@v1-alpha
- name: Setup | Rust
uses: hecrj/setup-rust-action@v2
with:
rust-version: stable
components: clippy
- name: Test data-transforms/flatten
if: needs.setup.outputs.data-transforms-flatten == 'true'
run: cd data-transforms/flatten && node test.js
- name: Test data-transforms/iss_demo
if: needs.setup.outputs.data-transforms-iss == 'true'
run: cd data-transforms/iss_demo && node test.js
- name: Test data-transforms/redaction
if: needs.setup.outputs.data-transforms-redaction == 'true'
run: cd data-transforms/redaction/demo && node test.js
- name: Test data-transforms/regex
if: needs.setup.outputs.data-transforms-regex == 'true'
run: cd data-transforms/regex && node test.js
- name: Test data-transforms/jq
if: needs.setup.outputs.data-transforms-jq == 'true'
run: cd data-transforms/jq && node test.js
- name: Test data-transforms/ts-converter
if: needs.setup.outputs.data-transforms-ts-converter == 'true'
run: cd data-transforms/ts-converter && node test.js