-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from danielfromearth/feature/issue-21-improve-…
…cicd-workflows Feature/issue 21 improve cicd workflows
- Loading branch information
Showing
7 changed files
with
70 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/** ] | ||
|
||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters