Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
richiecroker authored Mar 12, 2024
0 parents commit 3aa7f5c
Show file tree
Hide file tree
Showing 22 changed files with 1,558 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Don't allow windows checkouts to convert `\n` to `\r\n`, as this
# breaks stuff that is meant to be run in linux-in-docker
* text=auto eol=lf

# Don't show notebook files when diffing in GitHub
notebooks/**/*ipynb linguist-generated=true
4 changes: 4 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: 'Build this notebook'
runs:
using: 'docker'
image: '../../../Dockerfile'
54 changes: 54 additions & 0 deletions .github/workflows/build_runner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build-runner
on:
push:
paths:
- "run.py"

jobs:
build:
runs-on: windows-latest
name: Build windows executable for running notebook
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Build with pyinstaller
run: |
pyinstaller run.py --onefile
- name: Commit files
run: |
copy dist\run.exe run.exe
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add run.exe
git commit -m "Updated windows build of run.py"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
test_job:
# This is a copy of the yaml in `test_runner.yaml`, so that when
# there's a build, the tests are guaranteed to run *after* the
# build. Otherwise the build status would potentially overwrite
# the test status, making red PRs no longer red.
#
# There is currently no `include`-like functionality in Github
# Actions, though this is apparently going to change:
# https://github.com/actions/starter-workflows/issues/245
runs-on: ubuntu-latest
name: Test notebooks are runnable and up-to-date
needs: build
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Test
uses: ./.github/actions/build
with:
args: ./run_tests.sh
20 changes: 20 additions & 0 deletions .github/workflows/test_runner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Notebook checks

on:
push:
paths-ignore:
- "run.py"

jobs:
test_job:
# If you change this job, please also change it in
# build_runner.yaml (and see comments there for explanation)
runs-on: ubuntu-latest
name: Test notebooks are runnable and up-to-date
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Test
uses: ./.github/actions/build
with:
args: ./run_tests.sh
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Credentials for accessing BigQuery
bq-service-account.json

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# pyenv
.python-version

# jupyter
.ipynb_checkpoints
.ipython/
.jupyter/
.local/

# sublime test/pycharm
.idea/
.DS_Store

# Emacs
*~
Loading

0 comments on commit 3aa7f5c

Please sign in to comment.