Skip to content

Commit

Permalink
new ci files from nbdev
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Capelle committed Sep 21, 2020
1 parent 7baaf0b commit a3771c9
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 26 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#.github/workflows/changelog.yaml
name: changelog
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update CHANGELOG.md
uses: fastai/fastrelease/action/changelog@master
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
68 changes: 42 additions & 26 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,49 @@
name: CI
on: [push]
on: [push, pull_request, workflow_dispatch]
env:
HOME: /root
defaults:
run:
shell: bash

jobs:
build:
nb-sync:
runs-on: ubuntu-latest
container: fastai/jekyll
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.6'
architecture: 'x64'
- name: Install the library
run: |
pip install nbdev jupyter
pip install -e .
- name: Read all notebooks
run: |
nbdev_read_nbs
- name: Check if all notebooks are cleaned
- uses: actions/checkout@v2
- run: pip install -qe .
- name: Check if notebooks are synced and cleaned
uses: fastai/workflows/nb@master

nbdev_test_nbs:
runs-on: ubuntu-latest
container: fastai/jekyll
steps:
- uses: actions/checkout@v2
- name: Run tests
run: |
echo "Check we are starting with clean git checkout"
if [ -n "$(git status -uno -s)" ]; then echo "git status is not clean"; false; fi
echo "Trying to strip out notebooks"
nbdev_clean_nbs
echo "Check that strip out was unnecessary"
git status -s # display the status to see which nbs need cleaning up
if [ -n "$(git status -uno -s)" ]; then echo -e "!!! Detected unstripped out notebooks\n!!!Remember to run nbdev_install_git_hooks"; false; fi
- name: Check if there is no diff library/notebooks
pip install -qe .
pip install -qU fastcore
make test
fastpages-integration:
runs-on: ubuntu-latest
container: fastai/jekyll
steps:
- uses: actions/checkout@v2
- name: Install nbdev
run: |
if [ -n "$(nbdev_diff_nbs)" ]; then echo -e "!!! Detected difference between the notebooks and the library"; false; fi
- name: Run tests
pip install -qe .
pip install -qU fastcore
- uses: actions/checkout@v2
with:
repository: "fastai/fastpages"
path: "data"
- name: convert posts
run: |
nbdev_test_nbs
cd data
mkdir -p /fastpages
cp -r _action_files/* /fastpages/
/fastpages/action_entrypoint.sh
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: publish-release
on:
workflow_dispatch:
#push:
# branches:
# - master
env:
HOME: /root
jobs:
build:
if: |
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'push' && (github.event.head_commit.author.username == 'github-actions[bot]') && contains(github.event.head_commit.message, 'Update CHANGELOG.md'))
runs-on: ubuntu-latest
container: fastai/miniconda
steps:
- uses: actions/checkout@v2
- uses: fastai/workflows/conda-env@master
- name: Create condarc
run: |
cat >> ~/.condarc << EOF
conda-build:
anaconda_token: fa-5a8ca5e3-3c13-4260-8a54-362fa83d91f6
EOF
pip install anaconda-cli twine
- uses: fastai/fastrelease/action/publish@master
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/welcome.yml.off
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Greet New Contributors

on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "👋 @${{github.actor}}! Thank you for opening your first issue in this repo. We are so happy that you have decided to contribute and value your contribution. Please read these materials before proceeding: [Contributing Guide](https://github.com/fastai/fastai/blob/master/CONTRIBUTING.md) and [Code of Conduct](https://github.com/fastai/fastai/blob/master/CODE_OF_CONDUCT.md)."
pr-message: "👋 @${{github.actor}}! Thank you for opening your first pull request in this repo. We are so happy that you have decided to contribute and value your contribution. Please read these materials before proceeding: [Contributing Guide](https://github.com/fastai/fastai/blob/master/CONTRIBUTING.md) and [Code of Conduct](https://github.com/fastai/fastai/blob/master/CODE_OF_CONDUCT.md)."

0 comments on commit a3771c9

Please sign in to comment.