This repository has been archived by the owner on Nov 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from eccentricOrange:20-incorporate-crse-and-r…
…eddit-feedback 20-incorporate-crse-and-reddit-feedback
- Loading branch information
Showing
14 changed files
with
2,003 additions
and
1,206 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
name: Test, build and release | ||
|
||
on: [push] | ||
|
||
jobs: | ||
|
||
# test with pytest | ||
test: | ||
name: pytest | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# build SQLite from source, because I need 3.35<= | ||
- run: | | ||
wget https://sqlite.org/2022/sqlite-autoconf-3380500.tar.gz | ||
tar -xvf sqlite-autoconf-3380500.tar.gz | ||
- run: | | ||
./configure | ||
make | ||
sudo make install | ||
export PATH="/usr/local/lib:$PATH" | ||
working-directory: sqlite-autoconf-3380500 | ||
# run pytest | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
- run: pip install -r requirements.txt pytest | ||
- run: pytest | ||
env: | ||
LD_LIBRARY_PATH: /usr/local/lib | ||
|
||
# build executable for linux | ||
build-linux: | ||
name: build for linux | ||
runs-on: ubuntu-latest | ||
needs: test | ||
|
||
steps: | ||
|
||
# setup | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- run: | | ||
pip install pyinstaller | ||
mkdir bin | ||
mkdir build | ||
# build | ||
- run: | | ||
pyinstaller --distpath bin --clean --onefile --name npbc_updater-linux-x64 npbc_updater.py | ||
pip install -r requirements.txt | ||
pyinstaller --distpath bin --clean --add-data "data/schema.sql:." --onefile --name npbc_cli-linux-x64 npbc_cli.py | ||
# upload artifacts | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: bin | ||
name: npbc_cli-linux-x64 | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: bin | ||
name: npbc_updater-linux-x64 | ||
|
||
# build executable for windows | ||
build-windows: | ||
name: build for windows | ||
runs-on: windows-latest | ||
needs: test | ||
|
||
steps: | ||
|
||
# setup | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- run: | | ||
pip install pyinstaller | ||
mkdir bin | ||
mkdir build | ||
# build | ||
- run: | | ||
pyinstaller --distpath bin --clean --onefile --name npbc_updater-windows-x64 npbc_updater.py | ||
pip install -r requirements.txt | ||
pyinstaller --distpath bin --clean --add-data "data/schema.sql;." --onefile --name npbc_cli-windows-x64 npbc_cli.py | ||
# upload artifacts | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: bin | ||
name: npbc_cli-windows-x64 | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: bin | ||
name: npbc_updater-windows-x64 | ||
|
||
# build executable for macos | ||
build-macos: | ||
name: build for macos | ||
runs-on: macos-latest | ||
needs: test | ||
|
||
steps: | ||
|
||
# setup | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- run: | | ||
pip install pyinstaller | ||
mkdir bin | ||
mkdir build | ||
# build | ||
- run: | | ||
pyinstaller --distpath bin --clean --onefile --name npbc_updater-macos-x64 npbc_updater.py | ||
pip install -r requirements.txt | ||
pyinstaller --distpath bin --clean --add-data "data/schema.sql:." --onefile --name npbc_cli-macos-x64 npbc_cli.py | ||
# upload artifacts | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: bin | ||
name: npbc_cli-macos-x64 | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: bin | ||
name: npbc_updater-macos-x64 | ||
|
||
# create release from tag | ||
release: | ||
|
||
# ensure that build is complete for all platforms | ||
needs: | ||
- build-linux | ||
- build-macos | ||
- build-windows | ||
|
||
# run only if we're on a tag beginning with 'v' ('v1.2.5', for example) | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
|
||
# download the artifacts | ||
- run: mkdir bin | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
path: bin | ||
|
||
# do the release | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "bin/npbc*/*" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
generateReleaseNotes: true | ||
artifactErrorsFailBuild: true | ||
prerelease: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
INSERT INTO papers (name) | ||
VALUES | ||
('paper1'), | ||
('paper2'), | ||
('paper3'); | ||
|
||
INSERT INTO papers_days (paper_id, day_id) | ||
VALUES | ||
(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), | ||
(2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), | ||
(3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6); | ||
|
||
INSERT INTO papers_days_delivered (paper_day_id, delivered) | ||
VALUES | ||
(01, 0), (02, 1), (03, 0), (04, 0), (05, 0), (06, 1), (07, 1), | ||
(08, 0), (09, 0), (10, 0), (11, 0), (12, 1), (13, 0), (14, 1), | ||
(15, 1), (16, 1), (17, 0), (18, 0), (19, 1), (20, 1), (21, 1); | ||
|
||
INSERT INTO papers_days_cost (paper_day_id, cost) | ||
VALUES | ||
(01, 0.0), (02, 6.4), (03, 0.0), (04, 0.0), (05, 0.0), (06, 7.9), (07, 4.0), | ||
(08, 0.0), (09, 0.0), (10, 0.0), (11, 0.0), (12, 3.4), (13, 0.0), (14, 8.4), | ||
(15, 2.4), (16, 4.6), (17, 0.0), (18, 0.0), (19, 3.4), (20, 4.6), (21, 6.0); | ||
|
||
INSERT INTO undelivered_strings (year, month, paper_id, string) | ||
VALUES | ||
(2020, 11, 1, '5'), | ||
(2020, 11, 1, '6-12'), | ||
(2020, 11, 2, 'sundays'), | ||
(2020, 11, 3, '2-tuesday'), | ||
(2020, 10, 3, 'all'); |
Oops, something went wrong.