Skip to content

Commit c4108d9

Browse files
committed
Use GH action instead travis for CI.
Signed-off-by: Shivam Sandbhor <shivam.sandbhor@gmail.com>
1 parent d886469 commit c4108d9

2 files changed

Lines changed: 46 additions & 31 deletions

File tree

.github/workflows/main.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
on: pull_request
3+
jobs:
4+
unit_tests:
5+
runs-on: ubuntu-latest
6+
7+
services:
8+
# Label used to access the service container
9+
postgres:
10+
image: postgres
11+
env:
12+
POSTGRES_PASSWORD: vulnerablecode
13+
POSTGRES_DB: vulnerablecode
14+
# Set health checks to wait until postgres has started
15+
options: >-
16+
--health-cmd pg_isready
17+
--health-interval 10s
18+
--health-timeout 5s
19+
--health-retries 5
20+
ports:
21+
# Maps tcp port 5432 on service container to the host
22+
- 5432:5432
23+
steps:
24+
- name: Check out repository code
25+
uses: actions/checkout@v2
26+
27+
- name: Set up Python 3.8
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: 3.8
31+
32+
- name: Install dependencies
33+
run: |
34+
sudo apt install python3-dev postgresql libpq-dev build-essential libxml2-dev libxslt1-dev
35+
python -m pip install --upgrade pip
36+
pip install -r requirements.txt
37+
38+
- name: Run tests
39+
run: pytest
40+
env:
41+
# The hostname, username used to communicate with the PostgreSQL service container
42+
POSTGRES_HOST: localhost
43+
VC_DB_USER: postgres
44+
POSTGRES_PORT: 5432
45+
DJANGO_DEV: 1
46+
GH_TOKEN: 1

.travis.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)