Skip to content

Commit ab34c6b

Browse files
authored
Migrate Travis build to Github Actions (#263)
* Initial commit of Python workflow from Github defaults * Add python steps from the travis file * Update insurers.py * Update insurers.py * Rename pythonapp.yml to build.yml * Add default node build * Updates to match Travis build * Update path * Try making sure all tests runs
1 parent 5705108 commit ab34c6b

File tree

2 files changed

+63
-3
lines changed

2 files changed

+63
-3
lines changed

.github/workflows/build.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python application
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
backend:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python 3.7
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: 3.7
23+
- name: Install dependencies
24+
run: |
25+
pip install pipenv
26+
pipenv sync --dev
27+
- name: Lint with flake8
28+
run: |
29+
pip install flake8
30+
# stop the build if there are Python syntax errors or undefined names
31+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34+
- name: Test with pytest
35+
run: |
36+
pipenv run python manage.py test --settings=core.settings.test
37+
38+
frontend:
39+
runs-on: ubuntu-latest
40+
41+
strategy:
42+
matrix:
43+
node-version: [10.15.3]
44+
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: Use Node.js ${{ matrix.node-version }}
48+
uses: actions/setup-node@v1
49+
with:
50+
node-version: ${{ matrix.node-version }}
51+
- name: lint
52+
run: |
53+
cd frontend
54+
yarn install
55+
yarn lint
56+
- name: test
57+
run: |
58+
cd frontend
59+
yarn test
60+

core/tests/insurers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ def test_create_insurer(self):
1818
Ensure we can create a new insurer
1919
"""
2020
headers = self.auth_headers_for_user('front_desk')
21-
url = reverse('insurer-list')
22-
data = {'name': "InsureCo, 'is_active': true}
21+
url = reversed('insurer-list')
22+
data = {'name': "InsureCo", 'is_active': True}
2323
response = self.client.post(url, data, format='json',follow=True, **headers)
2424

25-
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
25+
self.assertEqual(response.status_code, 201)
2626
self.assertEqual(Insurer.objects.count(), 1)
2727

2828
def test_insurers_api_when_authed_as_front_desk(self):

0 commit comments

Comments
 (0)