From d2f8ae5f92cb6be913d320e4929de7bf04965f53 Mon Sep 17 00:00:00 2001 From: Lewis Chambers Date: Mon, 3 Jun 2024 14:14:57 +0100 Subject: [PATCH] Inital workflow --- .github/workflows/doc-deployment.yml | 67 ---------------------------- .github/workflows/doc-test.yml | 28 ------------ .github/workflows/test-pipeline.yml | 13 ------ .github/workflows/test-version.yml | 23 ++++++++++ .github/workflows/test.yml | 34 -------------- 5 files changed, 23 insertions(+), 142 deletions(-) delete mode 100644 .github/workflows/doc-deployment.yml delete mode 100644 .github/workflows/doc-test.yml delete mode 100644 .github/workflows/test-pipeline.yml create mode 100644 .github/workflows/test-version.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/doc-deployment.yml b/.github/workflows/doc-deployment.yml deleted file mode 100644 index cd6fe5c..0000000 --- a/.github/workflows/doc-deployment.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Documentation Deployment - -on: - # Runs on pushes targeting the default branch - workflow_run: - workflows: ["Test Package"] - branches: ["main"] - types: - - completed - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Single deploy job since we're just deploying - deploy: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Set up Python - # This is the version of the action for setting up Python, not the Python version. - uses: actions/setup-python@v5 - with: - # Semantic version range syntax or exact version of a Python version - python-version: '3.12' - # Optional - x64 or x86 architecture, defaults to x64 - architecture: 'x64' - cache: 'pip' - - name: Install Dependencies - run: | - pip install --upgrade pip - pip install .[docs] - - name: Build Docs - run: | - python -c "import iotdevicesimulator; print(iotdevicesimulator.__version__)" - pushd docs - . ./make.sh build - - name: Upload artifact - if: ${{ github.head_ref == 'main' || github.ref_name == 'main' }} - uses: actions/upload-pages-artifact@v3 - with: - # Upload entire repository - path: 'docs/_build/html' - - name: Deploy to GitHub Pages - if: ${{ github.head_ref == 'main' || github.ref_name == 'main' }} - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/doc-test.yml b/.github/workflows/doc-test.yml deleted file mode 100644 index 8083c01..0000000 --- a/.github/workflows/doc-test.yml +++ /dev/null @@ -1,28 +0,0 @@ -# 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: Documentation Test - -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 \ No newline at end of file diff --git a/.github/workflows/test-pipeline.yml b/.github/workflows/test-pipeline.yml deleted file mode 100644 index dc92e8f..0000000 --- a/.github/workflows/test-pipeline.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Test Package - -on: [push, pull_request] - -permissions: - contents: read - -jobs: - tests: - uses: ./.github/workflows/test.yml - docs: - uses: ./.github/workflows/doc-test.yml - if: ${{ (github.event_name == 'pull_request' && github.head_ref != 'main') || (github.event_name == 'push' && github.ref_name != 'main') }} \ No newline at end of file diff --git a/.github/workflows/test-version.yml b/.github/workflows/test-version.yml new file mode 100644 index 0000000..d078d86 --- /dev/null +++ b/.github/workflows/test-version.yml @@ -0,0 +1,23 @@ +name: Test Package + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + get_version: + 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__)" \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index f2d31a0..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,34 +0,0 @@ -# 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: - build: - - 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 flake8 - pip install .[test] - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: pytest -m "not oracle" \ No newline at end of file