diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index a84cb1b..96716ac 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -37,7 +37,6 @@ 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: @@ -45,20 +44,26 @@ jobs: 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 }} @@ -70,6 +75,8 @@ 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} \ @@ -77,15 +84,21 @@ jobs: --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 \ @@ -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: @@ -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 }} @@ -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: @@ -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 @@ -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: @@ -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] diff --git a/CHANGELOG.md b/CHANGELOG.md index 33cf065..80ab6bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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))