-
Notifications
You must be signed in to change notification settings - Fork 4.8k
87 lines (73 loc) · 2.31 KB
/
build.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
name: Build
on:
workflow_call:
inputs:
relative-build-root:
required: true
type: string
outputs:
cache-key:
description: 'Computed cache key, used for restoring cache in other workflows'
value: ${{ jobs.build.outputs.cache-key }}
env:
BUILD_ROOT: ${{ github.workspace }}/${{ inputs.relative-build-root }}
jobs:
build:
name: Build dependencies
runs-on: ubuntu-22.04
outputs:
cache-key: ${{ steps.cache-key.outputs.cache-key }}
steps:
- name: Checkout Kong source code
uses: actions/checkout@v4
# these aren't necessarily used by all tests, but building them here will
# ensures that we have a warm cache when other tests _do_ need to build the
# filters
- name: Build WASM Test Filters
uses: ./.github/actions/build-wasm-test-filters
- name: Generate cache key
id: cache-key
uses: ./.github/actions/build-cache-key
- name: Lookup build cache
id: cache-deps
uses: actions/cache@v4
with:
path: ${{ env.BUILD_ROOT }}
key: ${{ steps.cache-key.outputs.cache-key }}
- name: Install packages
if: steps.cache-deps.outputs.cache-hit != 'true'
run: sudo apt update && sudo apt install libyaml-dev valgrind libprotobuf-dev
- name: Build Kong
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
make build-kong
chmod +rw -R "$BUILD_ROOT/kong-dev"
- name: Update PATH
run: |
echo "$BUILD_ROOT/kong-dev/bin" >> $GITHUB_PATH
echo "$BUILD_ROOT/kong-dev/openresty/nginx/sbin" >> $GITHUB_PATH
echo "$BUILD_ROOT/kong-dev/openresty/bin" >> $GITHUB_PATH
- name: Debug (nginx)
run: |
echo nginx: $(which nginx)
nginx -V 2>&1 | sed -re 's/ --/\n--/g'
ldd $(which nginx)
- name: Debug (luarocks)
run: |
echo luarocks: $(which luarocks)
luarocks --version
luarocks config
- name: Bazel Outputs
uses: actions/upload-artifact@v4
if: failure()
with:
name: bazel-outputs
path: |
bazel-out/_tmp/actions
retention-days: 3
- name: Build Dev Kong dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
make install-dev-rocks