From 4e17bd3c71a390be372d53e6100b8c5e11645cf2 Mon Sep 17 00:00:00 2001 From: Jarosenb Date: Mon, 10 Jan 2022 20:28:29 -0600 Subject: [PATCH 1/2] add github actions spec --- .github/workflows/main.yml | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..46d5e9a --- /dev/null +++ b/.github/workflows/main.yml @@ -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 From 1691612627802bcfdfb90dee03de42bd408d7999 Mon Sep 17 00:00:00 2001 From: Jarosenb Date: Mon, 10 Jan 2022 20:31:01 -0600 Subject: [PATCH 2/2] convert python-version to string --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 46d5e9a..b0d641c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: 3.10 + python-version: '3.10' - uses: actions/cache@v2 with: @@ -43,7 +43,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: 3.10 + python-version: '3.10' - uses: actions/cache@v2 with: