diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Test & Deploy.yml similarity index 56% rename from .github/workflows/Deploy.yml rename to .github/workflows/Test & Deploy.yml index a9674a6..8dcda30 100644 --- a/.github/workflows/Deploy.yml +++ b/.github/workflows/Test & Deploy.yml @@ -6,9 +6,34 @@ on: - main jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pipinstall --upgrade pip + pip install -r requirements.txt + + - name: Run tests + run: pytest + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + deploy: runs-on: ubuntu-latest environment: Preview + needs: test steps: - name: Checkout code uses: actions/checkout@v2 @@ -37,10 +62,10 @@ jobs: run: | zip -r deployment_package.zip . -# - name: Deploy to AWS Lambda - Production -# if: env.ENVIRONMENT == 'Production' -# run: | -# aws lambda update-function-code --function-name prod-lta-datasets-updater --zip-file fileb://deployment_package.zip + # - name: Deploy to AWS Lambda - Production + # if: env.ENVIRONMENT == 'Production' + # run: | + # aws lambda update-function-code --function-name prod-lta-datasets-updater --zip-file fileb://deployment_package.zip - name: Deploy to AWS Lambda - Preview run: |