Skip to content

Commit af07237

Browse files
committed
Tests of new git workflows
1 parent ced3416 commit af07237

4 files changed

Lines changed: 48 additions & 22 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
1-
name: Test
1+
name: Install package
22

3-
# Controls when the action will run. Triggers the workflow on push or pull request
4-
# events but only for the master branch
53
on:
6-
push:
7-
branches: [ main ]
8-
pull_request:
9-
branches: [ main ]
4+
workflow_call:
105

11-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
126
jobs:
13-
# This workflow contains a single job called "build"
14-
build:
15-
# The type of runner that the job will run on
7+
install:
168
runs-on: ubuntu-22.04
179
strategy:
1810
matrix:
1911
python-version: [ "3.10" ]
2012
poetry-version: [ "1.6.1" ]
21-
22-
# Steps represent a sequence of tasks that will be executed as part of the job
2313
steps:
24-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2514
- name: Checkout repository
2615
uses: actions/checkout@v3
2716
with:
@@ -31,6 +20,7 @@ jobs:
3120
uses: actions/setup-python@v2
3221
with:
3322
python-version: ${{ matrix.python-version }}
23+
3424
- name: Set up Poetry ${{ matrix.poetry-version }}
3525
uses: abatilo/actions-poetry@v2.0.0
3626
with:
@@ -49,11 +39,4 @@ jobs:
4939

5040
- name: Install dependencies
5141
run: |
52-
poetry install -E percep
53-
# - name: Lint with flake8
54-
# run: |
55-
# # stop the build if there are Python syntax errors or undefined names
56-
# poetry run flake8 ./avstack --count --max-line-length=127 --show-source --statistics
57-
- name: Run tests
58-
run: |
59-
poetry run pytest tests
42+
poetry install -E percep

.github/workflows/test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Run unit tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
install:
8+
uses: install.yml
9+
test:
10+
steps:
11+
# - name: Lint with flake8
12+
# run: |
13+
# # stop the build if there are Python syntax errors or undefined names
14+
# poetry run flake8 ./avstack --count --max-line-length=127 --show-source --statistics
15+
- name: Run tests
16+
run: |
17+
poetry run pytest tests

.github/workflows/test_on_main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Run tests on main branch
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
install:
11+
uses: install.yml
12+
test:
13+
uses: test.yml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Run tests on workflows branch
2+
3+
on:
4+
push:
5+
branches: [ workflows ]
6+
pull_request:
7+
branches: [ workflows ]
8+
9+
jobs:
10+
install:
11+
uses: install.yml
12+
test:
13+
uses: test.yml

0 commit comments

Comments
 (0)