-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c05419
commit 6aec323
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
name: Run Tests | ||
|
||
on: | ||
pull_request: | ||
types: [labeled] | ||
|
||
env: | ||
TF_API_TOKEN: "${{ secrets.TERRAFORM_API_TOKEN }}" | ||
ORGANIZATION: science-and-design | ||
PROJECT: Hush Line | ||
WORKSPACE: hushline-${{ github.head_ref }} | ||
|
||
jobs: | ||
deploy: | ||
if: ${{ github.event.label.name == 'dev-deploy' }} | ||
runs-on: unbuntu-latest | ||
steps: | ||
- name: checkout terraform | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 'scidsg/hushline-infra' | ||
|
||
- name: Use branch workspace | ||
uses: dflook/terraform-new-workspace@v1.43.0 | ||
with: | ||
path: terraform | ||
workspace: dev-${{ github.head_ref }} | ||
|
||
- name: Deploy test infrastrucutre | ||
uses: dflook/terraform-plan@v1.43.0 | ||
with: | ||
path: terraform | ||
workspace: dev-${{ github.head_ref }} | ||
|
||
run-lint-and-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Poetry | ||
run: pip install poetry | ||
|
||
- name: Cache Python dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | ||
${{ runner.os }}-poetry- | ||
path: | | ||
~/.cache/pypoetry | ||
- name: Install Python dependencies | ||
run: poetry install | ||
|
||
- name: Lint | ||
run: poetry run make lint | ||
|
||
- name: Test | ||
run: poetry run make test |