Skip to content

Commit

Permalink
build: merge dev into main
Browse files Browse the repository at this point in the history
  • Loading branch information
svange committed Nov 10, 2023
2 parents 8c57e33 + bc1b15a commit 3b47875
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
41 changes: 34 additions & 7 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,33 @@ env:
jobs:
pre-commit-tests:
uses: ./.github/workflows/pre-commit.yml
if: "!contains(github.event.head_commit.message, 'chore(release):')"
name: Enforce commit standards
secrets: inherit
permissions:
id-token: write
contents: read

deploy-infrastructure:
if: "!contains(github.event.head_commit.message, 'chore(release):')"

name: Deploy infrastructure
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
if: "!contains(github.event.head_commit.message, 'chore(release):')"

- uses: aws-actions/setup-sam@v2
if: "!contains(github.event.head_commit.message, 'chore(release):')"

with:
use-installer: true

- name: Build resources
if: "!contains(github.event.head_commit.message, 'chore(release):')"

run: sam build --template ${SAM_TEMPLATE} --use-container

- name: Assume the testing pipeline user role
if: "!contains(github.event.head_commit.message, 'chore(release):')"

uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ env.PIPELINE_USER_ACCESS_KEY_ID }}
Expand All @@ -70,22 +75,30 @@ jobs:
role-skip-session-tagging: true

- name: Upload artifacts
if: "!contains(github.event.head_commit.message, 'chore(release):')"

run: |
sam package \
--s3-bucket ${TESTING_ARTIFACTS_BUCKET} \
--region ${TESTING_REGION} \
--output-template-file packaged-testing.yaml
- name: Validate artifacts
if: "!contains(github.event.head_commit.message, 'chore(release):')"

run: |
sam validate --lint -t packaged-testing.yaml
- uses: actions/upload-artifact@v3
if: "!contains(github.event.head_commit.message, 'chore(release):')"

with:
name: packaged-testing.yaml
path: packaged-testing.yaml

- name: Deploy to feature stack
- name: Deploy to stack
if: "!contains(github.event.head_commit.message, 'chore(release):')"

shell: bash
run: |
sam deploy \
Expand All @@ -98,9 +111,12 @@ jobs:
--role-arn ${TESTING_CLOUDFORMATION_EXECUTION_ROLE} \
--parameter-overrides ResourceSuffix=Publish
- name: Skip tests if release commit
if: "contains(github.event.head_commit.message, 'chore(release):')"
run: echo "Skipping tests for release commit"

run-tests:
needs: [deploy-infrastructure, pre-commit-tests]
if: "!contains(github.event.head_commit.message, 'chore(release):')"
name: Run pytest CI/CD tests
strategy:
matrix:
Expand All @@ -111,6 +127,7 @@ jobs:

steps:
- name: Assume the testing pipeline user role
if: "!contains(github.event.head_commit.message, 'chore(release):')"
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ env.PIPELINE_USER_ACCESS_KEY_ID }}
Expand All @@ -125,8 +142,10 @@ jobs:
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
if: "!contains(github.event.head_commit.message, 'chore(release):')"
uses: actions/checkout@v4
- name: Set up python
if: "!contains(github.event.head_commit.message, 'chore(release):')"
id: setup-python
uses: actions/setup-python@v4
with:
Expand All @@ -135,7 +154,7 @@ jobs:
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry

if: "!contains(github.event.head_commit.message, 'chore(release):')"
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
Expand All @@ -146,6 +165,8 @@ jobs:
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
if: "!contains(github.event.head_commit.message, 'chore(release):')"

id: cached-poetry-dependencies
uses: actions/cache@v3
with:
Expand All @@ -155,21 +176,27 @@ jobs:
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
if: "steps.cached-poetry-dependencies.outputs.cache-hit != 'true' && !contains(github.event.head_commit.message, 'chore(release):')"
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install project
if: "!contains(github.event.head_commit.message, 'chore(release):')"
run: poetry install --no-interaction

#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Test with pytest
if: "!contains(github.event.head_commit.message, 'chore(release):')"
run: |
poetry run pytest tests -m ci_cd
- name: Skip tests if release commit
if: "contains(github.event.head_commit.message, 'chore(release):')"
run: echo "Skipping tests for release commit"

publish-prerelease:
if: github.ref == 'refs/heads/dev'
needs: [run-tests]
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,23 @@ All notable changes to this project will be documented in this file. See



## v0.23.0-dev.8 (2023-11-10)

### Fix

* fix: skipping unnecessary steps in pipeline ([`6cff920`](https://github.com/svange/openbrain/commit/6cff92072b366d2628d0694cf5267007cf0deb91))

* fix: skipping unnecessary steps in pipeline ([`1c371d9`](https://github.com/svange/openbrain/commit/1c371d9c5dccd286b1913f301d970d53be9714e6))

* fix: skipping unnecessary steps in pipeline ([`4e3a67f`](https://github.com/svange/openbrain/commit/4e3a67f2dca2f6cb453d8cbcb5e5f8063c0253a1))


## v0.23.0-dev.7 (2023-11-10)

### Chore

* chore(release): release 0.23.0-dev.7 ([`b1d4f0d`](https://github.com/svange/openbrain/commit/b1d4f0d8e6fe9abc7236eca6f42ee2c7b04383e8))

### Fix

* fix: tuning ci pipeline ([`7f9df0d`](https://github.com/svange/openbrain/commit/7f9df0d740bead7856b52a02d4ff37bd92b2ebe1))
Expand Down

0 comments on commit 3b47875

Please sign in to comment.