From 26383dd28bb002542be92376dc872893374bb444 Mon Sep 17 00:00:00 2001 From: Miles Turin <31150941+milesturin@users.noreply.github.com> Date: Tue, 3 May 2022 21:31:08 -0700 Subject: [PATCH] Created basic CI framework (#326) --- .github/workflows/unit-test.yml | 39 +++++++++++++++++++++++++++ skylark/test/unit_aws/.gitkeep | 0 skylark/test/unit_azure/.gitkeep | 0 skylark/test/unit_gcp/.gitkeep | 0 skylark/test/unit_nocloud/test_nop.py | 5 ++++ 5 files changed, 44 insertions(+) create mode 100644 .github/workflows/unit-test.yml create mode 100644 skylark/test/unit_aws/.gitkeep create mode 100644 skylark/test/unit_azure/.gitkeep create mode 100644 skylark/test/unit_gcp/.gitkeep create mode 100644 skylark/test/unit_nocloud/test_nop.py diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 000000000..5c2512429 --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,39 @@ +name: unittests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: "3.8" + + - name: Cache pip dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ hashFiles('setup.py') }}-pytest-pip + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e . + pip install -U pytest + + - name: Run unit tests + run: pytest skylark/test/unit_nocloud + #- name: Run cloud tests + ###consider only running cloud tests for PRs to main once we go open source + ###if: ${{ github.event_name == 'pull_request' && github.base_ref == github.event.repository.default_branch }} + #run: | + #pytest skylark/test/unit_aws + #pytest skylark/test/unit_azure + #pytest skylark/test/unit_gcp diff --git a/skylark/test/unit_aws/.gitkeep b/skylark/test/unit_aws/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/skylark/test/unit_azure/.gitkeep b/skylark/test/unit_azure/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/skylark/test/unit_gcp/.gitkeep b/skylark/test/unit_gcp/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/skylark/test/unit_nocloud/test_nop.py b/skylark/test/unit_nocloud/test_nop.py new file mode 100644 index 000000000..aad393d3b --- /dev/null +++ b/skylark/test/unit_nocloud/test_nop.py @@ -0,0 +1,5 @@ +def nop(): + return True + +def test_nop(): + assert nop()