Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test1 #232

Open
wants to merge 6 commits into
base: v2
Choose a base branch
from
Open

test1 #232

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/pdp-tester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Run PDP Tester

on:
pull_request:
branches:
- 'v2'

jobs:
pdp-tester:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/checkout@v4
with:
repository: permitio/permit-opa
ref: main
path: './permit-opa'
token: ${{ secrets.CLONE_REPO_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Pre build PDP tests
run: |
echo "1.1.1" | cut -d '-' -f 1 > permit_pdp_version
rm -rf custom
mkdir custom
build_root="$PWD"
cd ./permit-opa
find * \( -name '*go*' -o -name 'LICENSE.md' \) -print0 | xargs -0 tar -czf "$build_root"/custom/custom_opa.tar.gz --exclude '.*'

- uses: robinraju/release-downloader@v1
with:
repository: permitio/datasync
latest: true
fileName: factstore_server*
token: ${{ secrets.CLONE_REPO_TOKEN }}
out-file-path: "factdb"

- name: Build and load PDP Docker image
uses: docker/build-push-action@v5
with:
push: false
load: true
context: .
build-args: |
ALLOW_MISSING_FACTSTORE=false
platforms: linux/amd64
tags: permitio/pdp-v2:next
cache-from: type=gha
cache-to: type=gha,mode=max

# Checkout the pdp-tester repository
- name: Checkout pdp-tester repository
uses: actions/checkout@v3
with:
repository: "permitio/pdp-tester"
token: ${{ secrets.CLONE_REPO_TOKEN }}
path: './pdp-tester'

# Setup Python environment
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.12"

# Install dependencies for pdp-tester
- name: Install pdp-tester dependencies
working-directory: ./pdp-tester
run: |
pip install -r requirements.txt

# Run pdp-tester
- name: Run pdp-tester
working-directory: ./pdp-tester
env:
TOKEN: ${{ secrets.PDP_API_TOKEN_PDP_TESTER_STAGING }}
API_URL: https://permitio.api.stg.permit.io
INCLUDE_TAGS: '["next"]'
AUTO_REMOVE: "False"
SKIP_GENERATE: "True"
ENVIRONMENT: '{"PDP_ENABLE_FACTDB": true}'
run: |
python -m pdp_tester.main
Loading