-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DesignSafe-CI/github-actions
Add github actions spec
- Loading branch information
Showing
1 changed file
with
59 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,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 |