Skip to content

Commit 3c38c73

Browse files
fabianrbzmheap
authored andcommitted
Add GH action that runs the automated-tests every night
1 parent 27a72e6 commit 3c38c73

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Scheduled Automated Tests
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
concurrency:
8+
cancel-in-progress: true
9+
group: ${{ github.workflow }}
10+
11+
env:
12+
VITE_PORTAL_API_URL: ${{ vars.VITE_PORTAL_API_URL }}
13+
14+
jobs:
15+
run:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 30
18+
strategy:
19+
matrix:
20+
gateway:
21+
- '3.9'
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
submodules: 'recursive'
26+
27+
# Configure Ruby to build Jekyll site
28+
- name: Set up Ruby
29+
uses: ruby/setup-ruby@v1
30+
with:
31+
ruby-version: .ruby-version
32+
- name: Ruby gem cache
33+
uses: actions/cache@v4
34+
with:
35+
path: ${{ github.workspace }}/vendor/bundle
36+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-gems-
39+
- name: Bundle Setup
40+
run: bundle config path ${{ github.workspace }}/vendor/bundle
41+
- name: Bundle Install
42+
run: bundle install --jobs 4 --retry 3
43+
44+
# Configure Node to build assets
45+
- uses: actions/setup-node@v4
46+
with:
47+
node-version: "20"
48+
- name: Cache node modules
49+
uses: actions/cache@v4
50+
env:
51+
cache-name: cache-node-modules
52+
with:
53+
path: ~/.npm
54+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
55+
restore-keys: |
56+
${{ runner.os }}-build-${{ env.cache-name }}-
57+
58+
- name: npm install
59+
run: npm ci
60+
61+
- name: Run site
62+
run: |
63+
npx netlify dev & npx wait-on http://localhost:8888
64+
65+
- name: Download Kong License
66+
uses: Kong/kong-license@master
67+
id: getLicense
68+
with:
69+
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
70+
71+
- name: Generate instruction files
72+
working-directory: tools/automated-tests
73+
run: |
74+
npm ci
75+
npm run generate-instruction-files
76+
77+
- name: Run tests
78+
working-directory: tools/automated-tests
79+
env:
80+
KONG_LICENSE_DATA: ${{ steps.getLicense.outputs.license }}
81+
RUNTIME: gateway
82+
GATEWAY_VERSION: ${{ matrix.gateway }}
83+
run: |
84+
npm run run-tests

0 commit comments

Comments
 (0)