-
Notifications
You must be signed in to change notification settings - Fork 401
72 lines (60 loc) · 1.83 KB
/
api-tests-with-private-packages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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