-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9406fe
commit e2b2302
Showing
3 changed files
with
120 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,9 @@ | ||
# https://github.com/actions/labeler | ||
|
||
docs: docs/** | ||
|
||
front-end: frontend/** | ||
|
||
api: api/** | ||
|
||
github: .github/** |
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,96 @@ | ||
name: API Pull Request | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['Github Labeler'] | ||
push: | ||
branches: | ||
- master | ||
|
||
defaults: | ||
run: | ||
working-directory: test | ||
|
||
jobs: | ||
test: | ||
if: ${{ github.event_name == 'push' || contains( github.event.pull_request.labels.*.name, 'github') || contains( github.event.pull_request.labels.*.name, 'api') }} | ||
runs-on: General-Purpose-8c-Runner | ||
name: API Unit 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: 2 | ||
# matrix: | ||
# python-version: ['3.10', '3.11'] | ||
|
||
steps: | ||
- name: Cloning repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install requirements | ||
run: pip install -r requirements | ||
|
||
# - 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: Run Linters | ||
# run: make lint | ||
|
||
# - name: Create analytics database | ||
# env: | ||
# PGPASSWORD: postgres | ||
# run: createdb -h localhost -U postgres -p 5432 analytics | ||
|
||
# - name: Check for missing migrations | ||
# env: | ||
# DOTENV_OVERRIDE_FILE: .env-ci-testmon | ||
# opts: --no-input --dry-run --check | ||
# run: make django-make-migrations | ||
|
||
# - name: Restore cached testmon data | ||
# if: ${{ github.event_name == 'pull_request' }} | ||
# id: cache-testmon-restore | ||
# uses: actions/cache/restore@v3 | ||
# with: | ||
# enableCrossOsArchive: true | ||
# path: | | ||
# /home/runner/work/flagsmith/flagsmith/api/.testmondata* | ||
# key: testmon-data-python${{ matrix.python-version }}-${{ github.event.pull_request.base.sha }} | ||
# restore-keys: testmon-data-python${{ matrix.python-version }}- | ||
|
||
- name: Run Tests | ||
# env: | ||
# DOTENV_OVERRIDE_FILE: .env-ci-testmon | ||
run: pytest | ||
|
||
# - name: Save testmon data cache | ||
# id: cache-testmon-save | ||
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
# uses: actions/cache/save@v3 | ||
# with: | ||
# path: | | ||
# /home/runner/work/flagsmith/flagsmith/api/.testmondata* | ||
# key: testmon-data-python${{ matrix.python-version }}-${{github.sha}} | ||
|
||
# - name: Upload Coverage | ||
# uses: codecov/codecov-action@v3 | ||
# env: | ||
# PYTHON: ${{ matrix.python-version }} | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
# env_vars: PYTHON |
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,15 @@ | ||
name: Github Labeler | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
jobs: | ||
apply-labels: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/labeler@v4 |