Skip to content

Commit

Permalink
chore(deps): update to pact v2 and python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Oct 17, 2024
1 parent 1314555 commit 1802c87
Show file tree
Hide file tree
Showing 6 changed files with 865 additions and 388 deletions.
Empty file removed .env
Empty file.
17 changes: 3 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.8"
# - name: Install python version
# uses: gabrielfalcao/pyenv-action@v10
# with:
# default: 3.8.13
# command: pip install -U pip # upgrade pip after installing python
# - name: Create virtualenv for python 3.5.7
# run: pyenv local 3.8.13 && python3 -mvenv .venv
# - name: venv
# run: pyenv local 3.8.13 && python3 -mvenv .venv3813
python-version: "3.11"
- name: install pyenv
run: curl https://pyenv.run | bash
- name: set pyenv on path
Expand All @@ -43,12 +34,10 @@ jobs:
run: make venv
- name: Install
run: make deps
- name: Activate virtual env
- name: Activate virtual env & test
run: |
source .venv/bin/activate
make test
# - name: Test
# run: make test
- name: Publish pacts
run: GIT_BRANCH=${GIT_REF:11} make publish_pacts

Expand Down
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ ci: test publish_pacts can_i_deploy $(DEPLOY_TARGET)
# Run the ci target from a developer machine with the environment variables
# set as if it was on Travis CI.
# Use this for quick feedback when playing around with your workflows.
fake_ci: .env
fake_ci:
CI=true \
GIT_COMMIT=`git rev-parse --short HEAD`+`date +%s` \
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` \
make ci


publish_pacts: .env
publish_pacts:
@"${PACT_CLI}" publish ${PWD}/pacts --consumer-app-version ${GIT_COMMIT} --tag ${GIT_BRANCH} --branch ${GIT_BRANCH}

## =====================
## Build/test tasks
## =====================

test: .env
test:
python3 -m pytest

## =====================
Expand All @@ -51,18 +51,18 @@ deploy: deploy_app record_deployment
no_deploy:
@echo "Not deploying as not on main branch"

can_i_deploy: .env
can_i_deploy:
@"${PACT_CLI}" broker can-i-deploy \
--pacticipant ${PACTICIPANT} \
--version ${GIT_COMMIT} \
--to-environment production \
--retry-while-unknown 0 \
--retry-while-unknown 5 \
--retry-interval 10

deploy_app:
@echo "Deploying to production"

record_deployment: .env
record_deployment:
@"${PACT_CLI}" broker record-deployment --pacticipant ${PACTICIPANT} --version ${GIT_COMMIT} --environment production

## =====================
Expand Down Expand Up @@ -101,16 +101,13 @@ test_github_webhook:
## Misc
## ======================

.env:
touch .env

.PHONY: test

## ======================
## Python additions
## ======================
PROJECT := example-consumer-python-sns
PYTHON_MAJOR_VERSION := 3.8
PYTHON_MAJOR_VERSION := 3.11

sgr0 := $(shell tput sgr0)
red := $(shell tput setaf 1)
Expand Down
Loading

0 comments on commit 1802c87

Please sign in to comment.