Skip to content

Commit

Permalink
ci: Run rbac tests with unit on merge to main (#2772)
Browse files Browse the repository at this point in the history
  • Loading branch information
gagantrivedi authored Nov 15, 2023
1 parent 37879b2 commit 645f9b1
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/api-tests-with-private-packages.yml
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

1 comment on commit 645f9b1

@vercel
Copy link

@vercel vercel bot commented on 645f9b1 Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.