-
Notifications
You must be signed in to change notification settings - Fork 30
63 lines (57 loc) · 2.23 KB
/
tests_using_secrets.yaml
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
name: Tests using Secrets
# This workflow is triggered on pushes to the main branch and pull requests to the main branch.
# If the PR is coming from a fork, the workflow is triggered only if the PR gets labeled with 'safe to test',
# which can only be added by the maintainers.
on:
push:
branches:
- main
pull_request:
branches:
- main
pull_request_target:
types: [labeled]
branches:
- main
jobs:
extproc_tests:
name: External Processor
# Skip the pull_request event from forks as it cannot access secrets even if the PR is labeled with 'safe to test'.
if: (github.event.pull_request.head.repo.fork == false) ||
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: github.event.pull_request.head.repo.fork == false
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
if: contains(github.event.pull_request.labels.*.name, 'safe to test')
- uses: actions/setup-go@v5
with:
cache: false
go-version-file: go.mod
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin
key: extproc-tests-${{ hashFiles('**/go.mod', '**/go.sum', '**/Makefile') }}
- name: Install Envoy
env:
# TODO: use the latest envoy after 1.33 is released.
ENVOY_VERSION: envoyproxy/envoy-dev:latest
run: |
export ENVOY_BIN_DIR=$HOME/envoy/bin
mkdir -p $ENVOY_BIN_DIR
docker run -v $ENVOY_BIN_DIR:/tmp/coraza -w /tmp/coraza \
--entrypoint /bin/cp ${ENVOY_VERSION} /usr/local/bin/envoy .
echo $ENVOY_BIN_DIR >> $GITHUB_PATH
- name: Run unit tests
env:
TEST_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_BEDROCK_USER_AWS_ACCESS_KEY_ID }}
TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_BEDROCK_USER_AWS_SECRET_ACCESS_KEY }}
TEST_OPENAI_API_KEY: ${{ secrets.ENVOY_AI_GATEWAY_OPENAI_API_KEY }}
run: make test-extproc-e2e