Skip to content

Commit

Permalink
add ci pipelines (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrrypg authored Sep 2, 2022
1 parent 454b9a3 commit afca18f
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 107 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Bump version
on:
push:
branches:
- master
jobs:
bumpversion:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag_version.outputs.new_version }}
previous_tag: ${{ steps.tag_version.outputs.previous_tag }}
bump_commit_sha: ${{ steps.bumpversion.outputs.commit_hash }}
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.DEDALO_PAT }}
- name: Get next version
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
default_prerelease_bump: false
dry_run: true
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Create bumpversion
if: steps.tag_version.outputs.new_version
run: |
pip install bumpversion
bumpversion --new-version ${{ steps.tag_version.outputs.new_version }} setup.cfg
- name: Update Changelog
if: steps.tag_version.outputs.new_version
uses: stefanzweifel/changelog-updater-action@v1.6.0
with:
latest-version: ${{ steps.tag_version.outputs.new_tag }}
release-notes: ${{ steps.tag_version.outputs.changelog }}
- name: Commit bumpversion
id: bumpversion
if: steps.tag_version.outputs.new_version
uses: stefanzweifel/git-auto-commit-action@v4.14.1
with:
branch: ${{ github.ref }}
commit_message: "docs(bumpversion): ${{ steps.tag_version.outputs.previous_tag }} → ${{ steps.tag_version.outputs.new_version }}"
file_pattern: setup.cfg CHANGELOG.md eox_audit_model/*
release:
needs: bumpversion
if: needs.bumpversion.outputs.version
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag_version.outputs.new_tag }}
changelog: ${{ steps.tag_version.outputs.changelog }}
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.DEDALO_PAT }}
- name: Create tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_sha: ${{ needs.bumpversion.outputs.bump_commit_sha }}
default_bump: false
default_prerelease_bump: false
- name: Create a GitHub release
if: steps.tag_version.outputs.new_tag
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
draft: true
11 changes: 11 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint Commit Messages
on: [pull_request]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
25 changes: 25 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: labeler

on:
pull_request:
branches:
- 'master'

jobs:
labeler:
runs-on: ubuntu-latest
name: Label the PR size
steps:
- uses: CodelyTV/pr-size-labeler@v1.7.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_max_size: '10'
s_max_size: '100'
m_max_size: '500'
l_max_size: '1000'
fail_if_xl: 'true'
message_if_xl: >
'This PR exceeds the recommended size of 1000 lines.
Please make sure you are NOT addressing multiple issues with one PR.
Note this PR might be rejected due to its size.'
github_api_url: 'api.github.com'
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test suite workflow

on:
pull_request:
branches:
- 'master'

jobs:
Running-test:
runs-on: ubuntu-latest
strategy:
max-parallel: 2
matrix:
python-version: ["3.8"]
django: ["22"]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache dependency
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/test.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Dev Requirements
run: |
make install-dev-dependencies
- name: Run Python Tests
run: |
export TOXENV=${TOX_ENV//./}
make run-tests
env:
TOX_ENV: py${{matrix.python-version}}-django${{matrix.django}}
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.7.0] - 2021-10-26
### Added

- Tests for python 3.8.
- Compatibility notes to readme.

## [0.6.0] - 2021-08-18
### Added

- Support for batch requests. Handle lists in request data.
- Include new argument in decorator to show all the input parameters from the request.

## [0.5.1] - 2021-07-16
### Change

- Handle lists in request data.

## [0.5.0] - 2021-07-08
### Added

- Display date in admin list view and use date format with ms
- Include an API wrapper to be used in API views to record the request data.
- Add an option to record sensitive data without the actual value.

## [0.4.0] - 2021-05-24
### Added

- Added support for django-ipware 3.0.0 .

## [0.3.1] - 2021-05-18
### Fixed

- Add missing parameters in celery task call.

## [0.3.0] - 2021-04-29
## Change

- The model is created asynchronously in order to avoid atomic blocks.

## [0.2.1] - 2020-12-28
### Fixed

- Changes made in AuditModel.
- Added missing migration.

## [0.2.0] - 2020-10-23
### Added

- Added support for Django 2.2.

## [0.1.0] - 2020-08-18-
### Added

- First release on PyPI.
101 changes: 0 additions & 101 deletions CHANGELOG.rst

This file was deleted.

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ clean: ## delete most git-ignored files
requirements: ## install environment requirements
pip install -r requirements/base.txt

install-dev-dependencies: ## install tox
pip install -r requirements/tox.txt

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -qr requirements/pip-tools.txt
Expand Down
5 changes: 1 addition & 4 deletions requirements/tox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#
# make upgrade
#
--index-url http://edx.devstack.devpi:3141/root/pypi/+simple/
--extra-index-url https://pypi.python.org/simple
--trusted-host edx.devstack.devpi

backports.entry-points-selectable==1.1.0
# via virtualenv
Expand Down Expand Up @@ -41,7 +38,7 @@ six==1.16.0
# virtualenv
toml==0.10.2
# via tox
tox==3.24.4
tox==3.24.5
# via -r requirements/tox.in
virtualenv==20.9.0
# via tox
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[bumpversion]
current_version = 0.7.3
commit = True
tag = True
commit = False
tag = False

[isort]
default_section = THIRDPARTY
Expand Down

0 comments on commit afca18f

Please sign in to comment.