Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GH-169] Fix create-release.yml Workflow Issues and Update Poetry Tox Command Syntax #172

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- main
- dry-run-create-release
workflow_dispatch:
soufianerafik marked this conversation as resolved.
Show resolved Hide resolved

env:
STEP_SCRIPTS: ${{ github.workspace }}/.github/steps/create-release
Expand Down Expand Up @@ -40,31 +41,45 @@ jobs:
- uses: UWIT-IAM/actions/[email protected]
with:
gcloud-token: ${{ secrets.GCR_TOKEN }}
- name: Install poetry
uses: abatilo/[email protected]

- name: Set up Python 3.10
soufianerafik marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Poetry with pip
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry --version

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we move up to a more recent Python, we should not have poetry installed in the proect and rather use pipx to separate out that tool per their recommendation.



- run: |
sudo apt-get -y install jq
poetry run pip install uw-it-build-fingerprinter tox
- run: |
poetry run pip install tox uw-it-build-fingerprinter

- name: Validate Build and Test
run: |
poetry run tox -e build-layers \
-- -t ${{ env.version }} --release ${{ env.version }} --cache \
-- -- -t ${{ env.version }} --release ${{ env.version }} --cache \
--build-arg HUSKY_DIRECTORY_VERSION=${{ env.version }}
poetry run tox -e unit-tests
# Build layers with the -k option to avoid installing a lot of
# unnecessary dependencies. We can also skip black/flake8 for
# this phase, because the code has already been accepted into
# the repository.
name: Validate build

- name: Create release ${{ needs.configure-release.outputs.version }}
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.configure-release.outputs.version }}
if: github.ref == 'refs/heads/main'

- run: docker push gcr.io/uwit-mci-iam/husky-directory:${{ env.version }}
- name: Push Docker image
run: docker push gcr.io/uwit-mci-iam/husky-directory:${{ env.version }}
if: github.ref == 'refs/heads/main'

- run: |
- name: Deploy
run: |
./scripts/deploy.sh -t dev -v ${{ env.version }} \
${{ github.ref != 'refs/heads/main' && '-x' || '' }}
Loading