From 6d6e150631f853005e5e90d358dc779c00e41acb Mon Sep 17 00:00:00 2001 From: Ajin Abraham Date: Fri, 1 Sep 2023 20:40:33 -0700 Subject: [PATCH] Create unit_tests.yml --- .github/workflows/unit_tests.yml | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/unit_tests.yml diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml new file mode 100644 index 00000000..e84f4d08 --- /dev/null +++ b/.github/workflows/unit_tests.yml @@ -0,0 +1,46 @@ +name: Unit Tests + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + container-job: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + steps: + - name: Check out repository code + - uses: actions/checkout@v3 + + - name: Set up Python3 + uses: actions/setup-python@v3 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip tox + pip install -r requirements.txt + + - name: Run tests + run: | + tox -e py + env: + POSTGRES_HOST: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_PORT: 5432 + POSTGRES_DB: nodejsscan + SQLALCHEMY_DATABASE_URI: postgresql://postgres:postgres@localhost/nodejsscan