Skip to content

Commit

Permalink
Refactored git workflow/renamed LICENSE file
Browse files Browse the repository at this point in the history
  • Loading branch information
t0mz06 committed Jan 10, 2024
1 parent 5864abd commit 6c13e01
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: build

on:
push:
branches: main
branches: [main]
pull_request:
branches: [develop, release-**]
branches: [develop]

jobs:
build:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: coverage

on:
push:
branches: main
branches: [main]
pull_request:
branches: [develop, release-**]
branches: [develop]

jobs:
coverage:
Expand All @@ -23,7 +23,7 @@ jobs:
id: cov
shell: bash {0}
run: |
pytest --mock-url="${{ secrets.API_URL }}" --cov-fail-under=95 --cov-report=term-missing --cov-report=xml --cov=pytmv1 --verbose
pytest --mock-url="${{ secrets.MOCK_URL }}" --cov-fail-under=95 --cov-report=term-missing --cov-report=xml --cov=pytmv1 --log-cli-level="DEBUG" --verbose
rc=$?
echo "total=$(head -2 coverage.xml|grep -Po 'line-rate="\K\d{1}\.?\d{0,4}' |awk '{print $1 * 100}'|cut -d. -f1)" >> $GITHUB_OUTPUT
exit $rc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: lint

on:
push:
branches: main
branches: [main]
pull_request:
branches: [develop, release-**]
branches: [develop]

jobs:
black:
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ jobs:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version }}
BRANCH: release-${{ github.event.inputs.version }}
BRANCH: releases/${{ github.event.inputs.version }}
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.GIT_BOT_SSH_KEY }}
ssh-key: ${{ secrets.USER_SSH_KEY }}
fetch-depth: 0
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Set up Git
run: |
git config --add user.name "TrendATI-bot"
git config --add user.email "[email protected]"
git config --add user.name "${{ secrets.USER_NAME }}"
git config --add user.email "${{ secrets.USER_MAIL }}"
- name: Run build
run: |
pip install --upgrade hatch
Expand All @@ -45,7 +45,10 @@ jobs:
git merge --no-ff ${{ env.BRANCH }}
git tag -a ${{ env.VERSION }} -m "Release ${{ env.VERSION }}"
git checkout ${{ env.BRANCH }}
git merge main
git merge --ff-only main
git push --atomic origin main ${{ env.BRANCH }} refs/tags/${{ env.VERSION }}
# Try to merge back release branch
git checkout develop
git merge --no-ff ${{ env.BRANCH }}
git push --atomic origin main develop ${{ env.BRANCH }} refs/tags/${{ env.VERSION }}
git branch -d ${{ env.BRANCH }}
git push origin develop :${{ env.BRANCH }}
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: test

on:
push:
branches: main
branches: [main]
pull_request:
branches: [develop, release-**]
branches: [develop]

jobs:
unit:
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run pytest
run: pytest --mock-url="https://dummy.com" --verbose ./tests/unit
run: pytest --log-cli-level="DEBUG" --verbose ./tests/unit
integration:
runs-on: ubuntu-latest
strategy:
Expand All @@ -36,4 +36,4 @@ jobs:
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run pytest
run: pytest --mock-url="${{ secrets.API_URL }}" --verbose ./tests/integration
run: pytest --mock-url="${{ secrets.MOCK_URL }}" --log-cli-level="DEBUG" --verbose ./tests/integration
File renamed without changes.

0 comments on commit 6c13e01

Please sign in to comment.