Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double triggers of workflows, add spacing to steps #215

Merged
merged 2 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,61 @@
name: Docs
on: [pull_request, push]

on:

# Trigger manually
workflow_dispatch:

# Trigger on any push to the master
push:
branches:
- master

# Trigger on any push to a PR that targets master
pull_request:
branches:
- master

jobs:

build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
pip install -e .[docs,examples,examples_unix]

- name: Make docs
run: |
cd docs
make html

- name: Run doctests
run: |
cd docs
make doctest

- name: Pull latest gh-pages
if: (contains(github.ref, 'master')) && github.event_name == 'push'
run: |
cd ..
git clone https://github.com/automl/ConfigSpace.git --branch gh-pages --single-branch gh-pages

- name: Copy new docs into gh-pages
if: (contains(github.ref, 'develop') || contains(github.ref, 'master')) && github.event_name == 'push'
run: |
branch_name=${GITHUB_REF##*/}
cd ../gh-pages
rm -rf $branch_name
cp -r ../ConfigSpace/docs/build/html $branch_name

- name: Push to gh-pages
if: (contains(github.ref, 'master')) && github.event_name == 'push'
run: |
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
name: pre-commit

on: [push, pull_request]
on:

# Trigger manually
workflow_dispatch:

# Trigger on any push to the master
push:
branches:
- master

# Trigger on any push to a PR that targets master
pull_request:
branches:
- master

jobs:

run-all-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install pre-commit
run: |
pip install pre-commit
pre-commit install

- name: Run pre-commit
run: |
pre-commit run --all-files