Skip to content

Commit

Permalink
Merge pull request #1 from DesignSafe-CI/github-actions
Browse files Browse the repository at this point in the history
Add github actions spec
  • Loading branch information
jarosenb authored Jan 11, 2022
2 parents 21808c6 + 2174769 commit 3f167b3
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

# Controls when the action will run. Triggers the workflow on pushes to main or on pull request events
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Server_Side_Unit_Tests:
runs-on: ubuntu-18.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}

- name: Install Python Packages
run: |
pip install -r requirements.txt
pip install pytest
- name: Run Server-side unit tests and generate coverage report
run: |
pytest server
Server_Side_Linting:
runs-on: ubuntu-18.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}

- name: Install Black formatter
run: |
pip install black
- name: Run Black formatter in check mode
run: |
black server --target-version py310 --check

0 comments on commit 3f167b3

Please sign in to comment.