Skip to content

fix(deps): Migrate MFA code to our codebase and bump djangorestframework #2254

fix(deps): Migrate MFA code to our codebase and bump djangorestframework

fix(deps): Migrate MFA code to our codebase and bump djangorestframework #2254

name: Run API tests with private package
on:
pull_request:
merge_group:
branches:
- main
paths:
- api/**
- .github/**
defaults:
run:
working-directory: api
env:
FLAGSMITH_RBAC_REVISION: v0.7.0
jobs:
test:
# NOTE: we need to include pull_request trigger to trigger `merge_group` event
# ref: https://github.com/orgs/community/discussions/51120#discussioncomment-6312578
if: ${{ github.event_name == 'merge_group' }}
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
steps:
- name: Cloning repo
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.12'
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@v4
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