diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 89a6f09..2fdfc61 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -18,9 +18,6 @@ jobs: python --version python -m pip install --upgrade pip pip install --upgrade setuptools wheel twine - # - name: Run Unit Tests - # run: | - # python -m unittest discover -v -f ./tests - name: Build and Package run: | python setup.py sdist bdist_wheel diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 0000000..0eea8f9 --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,65 @@ +name: Run Unit Tests + +on: [push, pull_request] + +jobs: + unit-tests: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade requirements.txt + - name: Run tests + run: | + python -m unittest discover -v -f ./tests/offline + + integration-tests: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ] + + services: + localstack: + image: localstack/localstack + ports: + - 4566:4566 + env: + SERVICES: ssm + DEFAULT_REGION: eu-west-1 + + env: + FIDELIUS_AWS_KEY_ARN: arn:aws:kms:eu-west-1:123456789012:alias/fidelius-key + FIDELIUS_AWS_REGION_NAME: eu-west-1 + FIDELIUS_AWS_ENDPOINT_URL: http://localhost:4566 + FIDELIUS_AWS_ACCESS_KEY_ID: somemadeupstuff + FIDELIUS_AWS_SECRET_ACCESS_KEY: notarealkey + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade requirements.txt + - name: Wait for LocalStack + run: | + until curl --fail http://localhost:4566/health; do sleep 5; done + - name: Run tests + run: | + python -m unittest discover -v -f ./tests/localstack