Skip to content

Commit 13860b5

Browse files
authored
Switch to poetry and update Ci workflow (#243)
1 parent 89efee9 commit 13860b5

7 files changed

+534
-447
lines changed

.github/workflows/ci.yml

+32-43
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Basketball Reference Web Scraper
1+
name: Build
22

33
on:
44
release:
5-
types: [published]
5+
types: [ published ]
66
push:
77
branches:
88
- v4
@@ -12,51 +12,44 @@ on:
1212

1313
jobs:
1414
build:
15-
runs-on: ubuntu-latest
1615
strategy:
1716
matrix:
18-
python-version: ['3.8']
17+
python-version: [ '3.7', '3.8', '3.9' ]
18+
os: [ 'macos-latest' ]
19+
runs-on: ${{ matrix.os }}
20+
name: build
1921
steps:
20-
- uses: actions/checkout@v2
21-
with:
22-
ref: ${{ github.ref }}
23-
- name: Set Up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v2
22+
- name: Checkout Project
23+
uses: actions/checkout@v3
24+
- name: Install Python
25+
uses: actions/setup-python@v4
2526
with:
2627
python-version: ${{ matrix.python-version }}
27-
- name: Install Dependencies
28-
uses: abatilo/actions-poetry@v1.5.0
29-
with:
30-
python_version: ${{ matrix.python-version }}
31-
poetry_version: 1.0.9
32-
args: install
33-
- name: Test
34-
uses: abatilo/actions-poetry@v1.5.0
35-
with:
36-
python_version: ${{ matrix.python-version }}
37-
poetry_version: 1.0.9
38-
args: run python -m coverage run -m unittest discover
28+
- name: Run build script
29+
run: bash ./scripts/build.sh "$(pwd)/dependencies"
30+
shell: bash
3931
- name: Upload Coverage To Codecov
40-
uses: codecov/codecov-action@v1
41-
docs:
32+
uses: codecov/codecov-action@v3
33+
documentation:
34+
strategy:
35+
matrix:
36+
python-version: [ '3.9' ]
37+
os: [ 'macos-latest' ]
38+
runs-on: ${{ matrix.os }}
4239
name: Publish Documentation
43-
runs-on: ubuntu-latest
44-
needs: build
4540
if: ${{ github.ref == 'refs/heads/v4' }}
4641
steps:
47-
- uses: actions/checkout@v2
42+
- name: Checkout Project
43+
uses: actions/checkout@v3
44+
- name: Install Python
45+
uses: actions/setup-python@v4
4846
with:
49-
ref: ${{ github.ref }}
50-
- name: Set Up Python ${{ matrix.python-version }}
51-
uses: actions/setup-python@v2
52-
with:
53-
python-version: '3.8'
54-
- name: Install Dependencies
55-
uses: abatilo/actions-poetry@v1.5.0
56-
with:
57-
python_version: '3.8'
58-
poetry_version: 1.0.9
59-
args: install
47+
python-version: ${{ matrix.python-version }}
48+
- name: Run build script
49+
run: bash ./scripts/build.sh
50+
shell: bash
51+
- name: Upload Coverage To Codecov
52+
uses: codecov/codecov-action@v3
6053
- name: Set Git Configuration
6154
run: |
6255
REMOTE="https://${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}"
@@ -67,9 +60,5 @@ jobs:
6760
GH_TOKEN: ${{ secrets.GH_TOKEN }}
6861
GH_NAME: ${{ secrets.GH_NAME }}
6962
GH_EMAIL: ${{ secrets.GH_EMAIL }}
70-
- name: Deploy To GitHub Pages
71-
uses: abatilo/actions-poetry@v1.5.0
72-
with:
73-
python_version: '3.8'
74-
poetry_version: 1.0.9
75-
args: run python -m mkdocs gh-deploy --clean --force
63+
- name: Publish Documentation
64+
run: bash ./scripts/Publish\ Documentation\ to\ GitHub\ Pages.sh "$(pwd)/dependencies/bin/poetry"

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ dist/
99
tests/integration/output/**.csv
1010
tests/integration/output/**.json
1111
!tests/integration/output/.gitkeep
12+
# Ignore generated code coverage files
13+
.coverage
14+
15+
dependencies/*

0 commit comments

Comments
 (0)