Skip to content

Commit fd178bd

Browse files
committed
Add GH action
1 parent be2d721 commit fd178bd

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

.github/workflows/main.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow on push or pull request events but only for the main branch
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
branches: [ main ]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "build"
17+
18+
build:
19+
# The type of runner that the job will run on
20+
runs-on: ubuntu-latest
21+
environment: Testing
22+
23+
# Steps represent a sequence of tasks that will be executed as part of the job
24+
steps:
25+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26+
- uses: actions/checkout@v2
27+
28+
- name: Install dependencies
29+
run: python -m pip install -r ./requirements.txt
30+
31+
- name: Set Atlas Cluster URI
32+
env:
33+
ATLAS_URI: ${{ secrets.ATLAS_URI }}
34+
run: echo "ATLAS_URI=$ATLAS_URI" > .env && echo "DB_NAME=pymongo_tutorial" >> .env
35+
36+
- name: Run tests
37+
run: python -m pip install pytest && python -m pytest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.env
2+
__pycache__/

0 commit comments

Comments
 (0)