Skip to content

Commit

Permalink
fix: make gha checks (docs, build, etc) triggered by main workflows
Browse files Browse the repository at this point in the history
Black, Isort, Build, Docs and API checks can now only be launched by other workflows
Add a workflow to check commits on branch other than main
Regroup the workflows for PR
Regroup the workflows for the main branch
Fix README.md
Update CHANGELOG
  • Loading branch information
drodarie committed Aug 1, 2024
1 parent 2916a4d commit b0640d2
Show file tree
Hide file tree
Showing 13 changed files with 104 additions and 71 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Check public API

on: [push, pull_request]
on: [workflow_call]

jobs:
check-api:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest

steps:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Black

on: [push, pull_request]
on: [workflow_call]

jobs:
black:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest

steps:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check branch commit

on:
push:
branches:
- '**' # matches every branch ...
- '!main' # ... that is not main

jobs:
isort:
uses: ./.github/workflows/isort.yml
black:
uses: ./.github/workflows/black.yml
build:
uses: ./.github/workflows/build.yml
docs:
uses: ./.github/workflows/docs.yml
api:
uses: ./.github/workflows/api.yml
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Build and test BSB

on: [push, pull_request]
on: [workflow_call]

jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: docs
name: Documentation

on: [push, pull_request]
on: [workflow_call]

jobs:
check-documentation:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest

steps:
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/documentation-links.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/ebrains.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Run isort
on:
- push

on: [workflow_call]

jobs:
isort:
Expand Down
35 changes: 32 additions & 3 deletions .github/workflows/release.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
name: Bump version, create release and deploy

on:
push:
branches:
- main
workflow-run:
workflows: ["Build and test BSB", "Documentation", "Black", "Run isort", "Check public API"]
branches: [main]
types: [completed]

jobs:
isort:
uses: ./.github/workflows/isort.yml
black:
uses: ./.github/workflows/black.yml
build:
uses: ./.github/workflows/build.yml
docs:
uses: ./.github/workflows/docs.yml
api:
uses: ./.github/workflows/api.yml

bump:
needs: [isort, black, build, docs, api]
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.semver.outputs.next }}
Expand Down Expand Up @@ -74,6 +87,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}

- name: Pull commit of version change
run: |
Expand Down Expand Up @@ -129,3 +143,18 @@ jobs:
run: |
python -m build
twine upload --verbose --repository pypi dist/*
deploy_ebrains:
runs-on: ubuntu-latest
needs: release
environment: EBRAINS
steps:
- name: Mirror to EBRAINS Gitlab
uses: wei/git-sync@v3
with:
source_repo: dbbs-lab/bsb-core
source_branch: main
destination_repo: https://push:${{ secrets.EBRAINS_GITLAB_ACCESS_TOKEN }}@gitlab.ebrains.eu/robinde/bsb-core.git
destination_branch: main
32 changes: 32 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Validate Pull Request

on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
validate-pr-title:
runs-on: ubuntu-latest
steps:
- name: PR Conventional Commit Validation
uses: ytanikin/[email protected]
with:
task_types: '["feat","fix","docs","test","ci","refactor","perf","revert"]'

preview-docs:
runs-on: ubuntu-latest
if: github.event.action != 'edited'
steps:
- uses: actions/checkout@v4
- name: Check modifications on docs
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
docs: # name of the filter
- 'docs/**'
- name: Preview Readthedocs
if: steps.filter.outputs.docs == 'true'
uses: readthedocs/actions/preview@v1
with:
project-slug: "bsb"
14 changes: 0 additions & 14 deletions .github/workflows/validate-pr.yml

This file was deleted.

17 changes: 13 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
# 4.3.0
## 4.4.0
### :sparkles: New Features
- [`f234265`](https://github.com/dbbs-lab/bsb-core/commit/f234265cbab4cd370332eb7dea794f872f6728d8) - add conventional commits and auto release *(PR #864 by @drodarie)*
- :arrow_lower_right: *addresses issue #860 opened by @Helveg*

### :bug: Bug Fixes
- [`32799b4`](https://github.com/dbbs-lab/bsb-core/commit/32799b4961811ac977dffafb49f3465ae9d6ab15) - use github app to bypass the main branch protections. *(PR #872 by @drodarie)*
- :arrow_lower_right: *fixes issue #870 opened by @drodarie*

## 4.3.0
* Introduction of a pool caching system
* Fix run iteration values in core
* Add FixedOutdegree

# 4.2.0
## 4.2.0
* Created geometric shape connection strategies
* Added support for multiple shapes for each cell type
* Written docs for geometric shapes
* fix typing and casting of post connectivity hooks
* fix readthedocs conflicts with furo package
* Add test to check if Allen API is down and skip related tests

# 4.1.1
## 4.1.1
* Fix reference of file_ref during configuration parsing when importing nodes.
* Use a more strict rule for Jobs enqueuing.
* Use certifi to fix ssl certificate issues.

# 4.1.0
## 4.1.0
* Added `ParsesReferences` mixin from bsb-json to allow reference and import in configuration files.
This includes also a recursive parsing of the configuration files.
* Added `swap_axes` function in morphologies
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Build Status](https://github.com/dbbs-lab/bsb-core/actions/workflows/build.yml/badge.svg)](https://github.com/dbbs-lab/bsb-core/actions/workflows/build.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Documentation Status](https://readthedocs.org/projects/bsb/badge/?version=latest)](https://bsb.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://travis-ci.com/dbbs-lab/bsb-core.svg?branch=main)](https://travis-ci.com/dbbs-lab/bsb-core)
[![codecov](https://codecov.io/gh/dbbs-lab/bsb-core/branch/main/graph/badge.svg)](https://codecov.io/gh/dbbs-lab/bsb-core)

<h3>:closed_book: Read the documentation on https://bsb.readthedocs.io/en/latest</h3>
Expand Down

0 comments on commit b0640d2

Please sign in to comment.