Skip to content

Commit 4f1f538

Browse files
authored
Merge pull request #46 from nilesh05apr/gh-test
GitHub actions for unit test and code quality check.
2 parents 792a71a + 4b63d42 commit 4f1f538

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test
2+
on:
3+
pull_request:
4+
types: [ready_for_review]
5+
6+
jobs:
7+
test:
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest, macOS-latest]
12+
python-version: [ '3.8', '3.9', '3.10' ]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
id: setup-python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Python version
24+
run: python -c "import sys; print(sys.version)"
25+
26+
# Install pipenv
27+
- name: Install pipenv
28+
run: python3 -m pip install --upgrade pipenv
29+
30+
# create .venv folder
31+
- name: create .venv folder
32+
run: mkdir -p .venv
33+
34+
# caching dependencies
35+
- name: Caching Dependencies
36+
uses: actions/cache@v2
37+
id: cache-dependencies
38+
with:
39+
path: .venv
40+
key: ${{ matrix.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
41+
42+
# install dependencies
43+
- name: Install dependencies
44+
if: steps.cache-dependencies.outputs.cache-hit != 'true'
45+
run: |
46+
pipenv install --dev --verbose
47+
pipenv install types-requests --dev
48+
# Run bash script
49+
- name: run Bash script
50+
run: pipenv run bash ./.github/check.sh

0 commit comments

Comments
 (0)