Skip to content

Commit

Permalink
Restructured github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis-chambers committed Jun 3, 2024
1 parent ce99748 commit 9af7c64
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
workflow_run:
workflows: ["Python Tests"]
branches: ["*"]
workflows: ["Test Package"]
branches: ["main"]
types:
- completed

Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/doc-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python Tests

on: [workflow_call]

permissions:
contents: read

jobs:
test_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[docs]
- name: Build Docs
run: |
python -c "import iotdevicesimulator; print(iotdevicesimulator.__version__)"
pushd docs
. ./make.sh build
12 changes: 12 additions & 0 deletions .github/workflows/test-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Test Package

on: [push, pull_request]

permissions:
contents: read

jobs:
tests:
uses: ./.github/workflows/test.yml
docs:
uses: ./.github/workflows/doc-test.yml
20 changes: 19 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

name: Python Tests

on: [push, pull_request]
on: [workflow_call]

permissions:
contents: read
Expand Down Expand Up @@ -32,3 +32,21 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: pytest -m "not oracle"

test_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[docs]
- name: Build Docs
run: |
python -c "import iotdevicesimulator; print(iotdevicesimulator.__version__)"
pushd docs
. ./make.sh build

0 comments on commit 9af7c64

Please sign in to comment.