Skip to content

Commit

Permalink
Merge pull request #22 from danielfromearth/feature/issue-21-improve-…
Browse files Browse the repository at this point in the history
…cicd-workflows

Feature/issue 21 improve cicd workflows
  • Loading branch information
danielfromearth authored Oct 10, 2023
2 parents 4e4a622 + 537febc commit 4520bed
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 28 deletions.
7 changes: 2 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
interval: "weekly"
# Raise pull requests for version updates
# to pip against the `develop` branch
target-branch: "develop"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
# Raise pull requests for version updates
# to pip against the `develop` branch
interval: "weekly"
target-branch: "develop"
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Lint and Test
# When code is pushed to a branch, run linting and tests, and
# then automatically increment the version number as appropriate for the branch source.
name: On a Push

# Controls when the workflow will run
on:
# Triggers the workflow on push events
push:
branches: [ develop, release/**, main, feature/**, issue/**, issues/** ]

Expand All @@ -11,22 +12,21 @@ on:

jobs:
run_tests:
uses: ./.github/workflows/run_tests.yml
uses: ./.github/workflows/reusable_run_tests.yml

bump_version:
needs: run_tests
runs-on: ubuntu-20.04

steps:
- name: Retrieve repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Poetry
- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.3.2
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/pull-request-received.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# When a pull request is opened, run linting and tests.
name: Pull Request Received

# read-only repo token
# no access to secrets
on:
pull_request:
branches: [ feature/**, issue/**, issues/** ]

jobs:
build_and_test:
uses: ./.github/workflows/reusable_run_tests.yml
48 changes: 48 additions & 0 deletions .github/workflows/release-created.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# As soon as a release branch is pushed, the minor version on develop is bumped automatically.
# This allows further development to continue on develop for ‘the next’ release.
name: Release Branch Created

# Run whenever a ref is created https://docs.github.com/en/actions/reference/events-that-trigger-workflows#create
on:
create

jobs:
# First job in the workflow builds and verifies the software artifacts
bump:
name: Bump minor version on develop

# The type of runner that the job will run on
runs-on: ubuntu-latest

# Only run if ref created was a release branch
if:
${{ startsWith(github.ref, 'refs/heads/release/') }}

steps:
- name: Retrieve repository (on the develop branch)
uses: actions/checkout@v4
with:
ref: 'refs/heads/develop'

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.3.2

- name: Bump minor version
run: |
poetry version ${GITHUB_REF#refs/heads/release/}
poetry version preminor
echo "software_version=$(poetry version | awk '{print $2}')" >> $GITHUB_ENV
- name: Commit Version Bump
run: |
git config --global user.name 'batchee bot'
git config --global user.email '[email protected]'
git commit -am "/version ${{ env.software_version }}"
git push
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Retrieve repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/run_tests_on_pull_requests.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [issue/16](https://github.com/danielfromearth/batchee/issues/16): Add a logo
### Changed
- [issue/11](https://github.com/danielfromearth/batchee/issues/11): Rename from concat_batcher to batchee
- [issue/21](https://github.com/danielfromearth/batchee/issues/21): Improve CICD workflows
### Deprecated
### Removed
### Fixed

0 comments on commit 4520bed

Please sign in to comment.