Skip to content

Commit

Permalink
Debug actions and precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Meyers committed Feb 22, 2024
1 parent 5023547 commit 30b0b57
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 31 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Integration Tests with Pytest

on:
schedule:
# Runs around midnight Pacific Time (UTC-7)
# Doesn't account for daylight saving transitions
- cron: "0 7 * * *"
workflow_dispatch:
inputs:
AIRFLOW_ENDPOINT:
description: "Base URL for the Airflow endpoint (i.e. http://abc.def.ghi:port-number)"
type: string

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Run integration tests
run: |
pytest -vv --gherkin-terminal-reporter unity-test/system/integration
52 changes: 21 additions & 31 deletions .github/workflows/smoke_tests.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,32 @@
name: Smoke Tests with Pytest

on: [pull_request]
on:
schedule:
# Runs around midnight Pacific Time (UTC-7)
# Doesn't account for daylight saving transitions
- cron: "0 7 * * *"
workflow_dispatch:
inputs:
AIRFLOW_ENDPOINT:
description: "Base URL for the Airflow endpoint (i.e. http://abc.def.ghi:port-number)"
type: string

jobs:
pre-commit:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Read .terraform-version
id: tf_version
run: echo "TF_VERSION=$(cat .terraform-version)" >> $GITHUB_ENV
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TF_VERSION }}
- name: Install Hadolint for pre-commit hook
run: |
wget -O /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64
chmod +x /usr/local/bin/hadolint
- name: Install TFLint for pre-commit hook

- name: Install dependencies
run: |
curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
- name: Install trivy for pre-commit hook
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Run smoke tests
run: |
sudo apt-get install wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/trivy.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sudo apt-get install trivy
# - name: Install dependencies for Python tests
# run: |
# pip install -e ".[test]"
- uses: pre-commit/[email protected]
with:
extra_args: --config .pre-commit-config-ci.yaml --all-files
# - name: Test with pytest
# run: |
# pytest -vv --gherkin-terminal-reporter unity-test/unit
pytest -vv --gherkin-terminal-reporter unity-test/system/smoke
23 changes: 23 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unit Tests with Pytest

on: [pull_request]

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Run unit tests
run: |
pytest -vv --gherkin-terminal-reporter unity-test/unit

0 comments on commit 30b0b57

Please sign in to comment.