Skip to content

Commit

Permalink
Merge pull request #2 from novakzaballa/ci/test-workflows2
Browse files Browse the repository at this point in the history
ci/test-workflows2
  • Loading branch information
novakzaballa authored Jan 16, 2024
2 parents 4bc0a85 + b16bc8d commit 81a8207
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 32 deletions.
42 changes: 24 additions & 18 deletions .github/workflows/api-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
name: API Pull Request

name: API Pull Request Github Labeler
on:
workflow_run:
workflows: ['Github Labeler']
types:
workflows:
- Test depends Github Labeler
types:
- completed


jobs:
test-job:
name: API Unit Tests
runs-on: ubuntu-latest
steps:
- name: Install requirements
run: pip install -r requirements.txt
- name: Run Tests
run: pytest

# 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
# jobs:
# test-job:
# name: Test Step
# runs-on: ubuntu-latest
# steps:
# - name: 'Trigger'
# run: echo 'The triggering workflow passed'

# if: ${{ github.event_name == 'push' || contains( github.event.pull_request.labels.*.name, 'github') || contains( github.event.pull_request.labels.*.name, 'api') }}

# services:
# postgres:
Expand All @@ -31,13 +46,6 @@ jobs:
# matrix:
# python-version: ['3.10', '3.11']

steps:
- name: Cloning repo
uses: actions/checkout@v3

- name: Install requirements
run: pip install -r requirements.txt

# - uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -72,8 +80,6 @@ jobs:
# key: testmon-data-python${{ matrix.python-version }}-${{ github.event.pull_request.base.sha }}
# restore-keys: testmon-data-python${{ matrix.python-version }}-

- name: Run Tests
run: pytest

# - name: Save testmon data cache
# id: cache-testmon-save
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/github-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Github Labeler

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/test-depends-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
name: Test depends workflow

# on:
# # pull_request:
# # types: [opened, synchronize, reopened, ready_for_review]
# workflow_run:
# workflows: ["Github Labeler"]
# types:
# - completed

name: Test depends Github Labeler
on:
workflow_run:
workflows: [Github Labeler]
workflows:
- Github Labeler
types:
- completed

# on:
# workflow_call:
# workflows:
# - Github Labeler
# types:
# - completed

jobs:
on-success:
test-job:
name: Test Step
runs-on: ubuntu-latest
steps:
- run: echo 'The triggering workflow passed'
- name: 'Trigger'
run: echo 'The triggering workflow passed'

0 comments on commit 81a8207

Please sign in to comment.