Skip to content

Commit 5a4788a

Browse files
committed
Changed CD to reuse CI
1 parent 06d86d2 commit 5a4788a

File tree

3 files changed

+10
-135
lines changed

3 files changed

+10
-135
lines changed

.github/workflows/dockerhub_push.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.
Lines changed: 3 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -10,77 +10,9 @@ permissions:
1010

1111
jobs:
1212
pdp-tests:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v4
17-
18-
- name: Set up QEMU
19-
uses: docker/setup-qemu-action@v3
20-
21-
- name: Set up Docker Buildx
22-
uses: docker/setup-buildx-action@v3
23-
24-
- uses: actions/checkout@v3
25-
with:
26-
repository: permitio/permit-opa
27-
ref: main
28-
path: './permit-opa'
29-
token: ${{ secrets.CLONE_REPO_TOKEN }}
30-
31-
- name: Pre build PDP tests
32-
run: |
33-
echo "${{ github.event.release.tag_name }}" | cut -d '-' -f 1 > permit_pdp_version
34-
rm -rf custom
35-
mkdir custom
36-
build_root="$PWD"
37-
cd ./permit-opa
38-
find * \( -name '*go*' -o -name 'LICENSE.md' \) -print0 | xargs -0 tar -czf "$build_root"/custom/custom_opa.tar.gz --exclude '.*'
39-
40-
- uses: robinraju/release-downloader@v1
41-
with:
42-
repository: permitio/datasync
43-
latest: true
44-
fileName: factstore_server*
45-
token: ${{ secrets.CLONE_REPO_TOKEN }}
46-
out-file-path: "factdb"
47-
48-
- name: Build and load image for PDP E2E tests
49-
uses: docker/build-push-action@v5
50-
with:
51-
push: false
52-
load: true
53-
context: .
54-
build-args: |
55-
ALLOW_MISSING_FACTSTORE=false
56-
platforms: linux/amd64
57-
tags: permitio/pdp-v2:test
58-
cache-from: type=gha
59-
cache-to: type=gha,mode=max
60-
61-
- uses: actions/checkout@v3
62-
with:
63-
repository: permitio/permit-backend
64-
ref: main
65-
path: './permit-backend'
66-
token: ${{ secrets.CLONE_REPO_TOKEN }}
67-
68-
- name: Python setup
69-
uses: actions/setup-python@v5
70-
with:
71-
python-version: '3.11.8'
72-
73-
- name: Run Pytests
74-
run: |
75-
python -m pip install --upgrade pip
76-
pip install ".[dev]"
77-
pytest -s --cache-clear horizon/tests/
78-
79-
- name: Run E2E tests
80-
working-directory: ./permit-backend/proactive_tests/sidecar
81-
run: |
82-
pip install requests pydantic==1.8.2 docker
83-
python sidecar_tester.py -k ${{ secrets.PERMIT_TESTS_TOKEN }} -u https://api.permit.io -2 permitio/pdp-v2:test --no-pull
13+
# Call the reusable tests workflow.
14+
uses: ./.github/workflows/tests.yml
15+
secrets: inherit
8416

8517
build-and-push-pdp-vanilla:
8618
needs: pdp-tests
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
name: PDP Sanity Tests
1+
name: PDP CI Tests
22

33
on:
44
pull_request:
55
push:
66
branches: [master, main, v*]
7+
workflow_call:
8+
secrets:
9+
PDP_TESTER_API_KEY:
10+
required: true
11+
CLONE_REPO_TOKEN:
12+
required: true
713

814
jobs:
915
pre-commit:
@@ -30,7 +36,6 @@ jobs:
3036
pip install ".[dev]"
3137
pytest -s --cache-clear horizon/tests/
3238
33-
3439
pdp-tester:
3540
runs-on: ubuntu-latest
3641
steps:

0 commit comments

Comments
 (0)