ci(test-private-package): update trigger to use pull_request #2487
Workflow file for this run
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
name: Run API tests with private package | |
on: | |
pull_request: | |
branches: | |
- main | |
types: [labeled] | |
defaults: | |
run: | |
working-directory: api | |
env: | |
FLAGSMITH_RBAC_REVISION: v0.7.0 | |
jobs: | |
test: | |
if: ${{ github.event.label.name == 'api' }} | |
runs-on: ubuntu-latest | |
name: API Tests | |
services: | |
postgres: | |
image: postgres:15.5-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 |