Skip to content

Commit

Permalink
Sync changes from staging repository (#1043)
Browse files Browse the repository at this point in the history
* Add validate Workflow; separate lint and test checks (#1)

* Add Workflow to upload on merge to main (#2)

* Add Workflow to upload on merge to main

* Update job names

* Update validate and upload step names (#3)

* Update Validate Workflow name

* Small tweaks
  • Loading branch information
Evan Gibler authored Dec 15, 2023
1 parent 48a851e commit a0b6039
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
on: pull_request

jobs:
make_lint:
name: lint and test
lint:
name: Lint
runs-on: ubuntu-latest

steps:
Expand All @@ -41,6 +41,3 @@ jobs:

- name: make lint
run: make lint

- name: make test
run: make test
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on: pull_request

jobs:
test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout panther-analysis
uses: actions/checkout@v4

- name: Set python version
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install pipenv
run: pip install pipenv

- name: Install
run: make install

- name: Setup venv
run: make venv

- name: make test
run: make test
39 changes: 39 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
branches:
- main

jobs:
upload:
name:
runs-on: ubuntu-latest
env:
API_HOST: ${{ secrets.API_HOST }}
API_TOKEN: ${{ secrets.API_TOKEN }}
steps:
- name: Validate Secrets
if: ${{ env.API_HOST == '' || env.API_TOKEN == '' }}
run: |
echo "API_HOST or API_TOKEN not set"
exit 0
- name: Checkout panther-analysis
uses: actions/checkout@v4

- name: Set python version
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install pipenv
run: pip install pipenv

- name: Install
run: make install

- name: Setup venv
run: make venv

- name: upload
run: |
pipenv run panther_analysis_tool upload --api-host ${{ env.API_HOST }} --api-token ${{ env.API_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on: pull_request

jobs:
validate:
name: Validate
runs-on: ubuntu-latest
env:
API_HOST: ${{ secrets.API_HOST }}
API_TOKEN: ${{ secrets.API_TOKEN }}
steps:
- name: Validate Secrets
if: ${{ env.API_HOST == '' || env.API_TOKEN == '' }}
run: |
echo "API_HOST or API_TOKEN not set"
exit 0
- name: Checkout panther-analysis
uses: actions/checkout@v4

- name: Set python version
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install pipenv
run: pip install pipenv

- name: Install
run: make install

- name: Setup venv
run: make venv

- name: validate
run: |
pipenv run panther_analysis_tool validate --api-host ${{ env.API_HOST }} --api-token ${{ env.API_TOKEN }}

0 comments on commit a0b6039

Please sign in to comment.