-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Run rbac tests with unit on merge to main (#2772)
- Loading branch information
1 parent
37879b2
commit 645f9b1
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Run API tests with private package | ||
|
||
on: | ||
merge_group: | ||
branches: | ||
- main | ||
paths: | ||
- api/** | ||
- .github/** | ||
|
||
defaults: | ||
run: | ||
working-directory: api | ||
|
||
env: | ||
FLAGSMITH_RBAC_REVISION: v0.4.1 | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: API Tests | ||
|
||
services: | ||
postgres: | ||
image: postgres:11.12-alpine | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
ports: ['5432:5432'] | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: ['3.10', '3.11'] | ||
|
||
steps: | ||
- name: Cloning repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'poetry' | ||
|
||
- name: Install Dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: make install-packages | ||
|
||
- name: Checkout rbac package | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: flagsmith/flagsmith-rbac | ||
token: ${{ secrets.GH_PRIVATE_ACCESS_TOKEN }} | ||
ref: ${{ env.FLAGSMITH_RBAC_REVISION }} | ||
path: ./flagsmith-rbac | ||
|
||
- name: Integrate RBAC module | ||
run: mv $GITHUB_WORKSPACE/flagsmith-rbac/rbac . | ||
shell: bash | ||
|
||
- name: integrate rbac tests | ||
run: ln -s $GITHUB_WORKSPACE/flagsmith-rbac/tests tests/rbac_tests | ||
shell: bash | ||
working-directory: api | ||
|
||
- name: Run Tests | ||
env: | ||
DOTENV_OVERRIDE_FILE: .env-ci | ||
run: make test |
645f9b1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
flagsmith-frontend-preview – ./frontend
flagsmith-frontend-preview-git-main-flagsmith.vercel.app
flagsmith-frontend-preview-flagsmith.vercel.app
flagsmith-frontend-production-native.vercel.app