Skip to content

Commit

Permalink
Merge pull request #15 from UMD-ARLIS/dev
Browse files Browse the repository at this point in the history
CI updates
  • Loading branch information
Jyyjy authored Sep 26, 2023
2 parents 2cc8d48 + e02ff04 commit 61af38d
Show file tree
Hide file tree
Showing 187 changed files with 457 additions and 21,252 deletions.
2 changes: 1 addition & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ notifications:
pullrequests_status: pr@flagon.apache.org
pullrequests_comment: notifications@flagon.apache.org
# Send dependabot PRs to commits@ instead
pullrequests_bot_dependabot: maintenance@flagon.apache.org
pullrequests_bot_dependabot: maintenance@flagon.apache.org
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*.in
LICENSE
NOTICE
env
.env
docs
doc_requirements.txt
docker
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Bump Version

on:
workflow_run:
workflows: ["Release Audit Tool"]
types:
- completed

jobs:
bump-version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: actions/checkout@v3
with:
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
fetch-depth: 0
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
changelog_increment_filename: body.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: "body.md"
tag_name: ${{ env.REVISION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,3 @@ jobs:
# Runs a single command using the runners shell
#- name: Run Makefile to generate the htmls
#run: make html

53 changes: 53 additions & 0 deletions .github/workflows/pytest_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Upload Python Package to PyPI Test

on:
workflow_run:
workflows: ["Bump Version"]
types:
- completed

jobs:
publish-test-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-in-project: true
virtualenvs-create: true
- name: Install dependencies
run: |
poetry --version
poetry install
- name: Build and publish
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config http-basic.testpypi $PYPI_USERNAME $PYPI_PASSWORD
make publish_pytest
68 changes: 68 additions & 0 deletions .github/workflows/rat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release Audit Tool

on:
workflow_run:
workflows: ["Test Suite"]
types:
- completed
branches:
- "master"
tags:
- "v*"

jobs:
rat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-in-project: true
virtualenvs-create: true
- name: Install dependencies
run: |
poetry --version
poetry install
- name: Build
run: poetry build
- name: Checkout RAT
uses: actions/checkout@v3
with:
repository: 'apache/creadur-rat'
ref: 'apache-rat-project-0.15'
path: 'rat'
- name: Setup Maven
uses: s4u/setup-maven-action@v1.9.0
with:
java-version: 17
checkout-path: maven
- name: Install RAT
run: |
cd rat/apache-rat
mvn clean install
- name: Run RAT
run: java -jar rat/apache-rat/target/apache-rat-0.15.jar -d dist/flagon_distill-*.tar.gz
61 changes: 61 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Test Suite

on:
pull_request:
branches:
- dev
- master
push:
branches:
- dev
- master

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-in-project: true
virtualenvs-create: true

- name: Install dependencies
run: |
poetry --version
poetry install
- name: Run tests
run: make test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

.DS_Store
.idea
.env

# Depedencies
.venv
Expand Down
44 changes: 29 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types:
- pre-commit
- commit-msg
- pre-push

default_stages:
- commit
- push

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
- repo: https://github.com/commitizen-tools/commitizen
rev: 3.8.0 # automatically updated by Commitizen
hooks:
- id: commitizen
stages: [commit-msg]
- hooks:
- id: flake8
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
repo: https://github.com/pycqa/flake8
rev: 6.1.0
- hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black"]
repo: https://github.com/psf/black
rev: 23.7.0
- hooks:
- args:
- --profile
- black
id: isort
repo: https://github.com/PyCQA/isort
rev: 5.12.0
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ sphinx:
python:
version: 3.7
install:
- requirements: docs/requirements.txt
- requirements: docs/requirements.txt
9 changes: 4 additions & 5 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
Changelog
=========

0.1.1 (2023-08-18)
0.1.0 (2022)
------------------
* Migrate package and build management to poetry
* Remove deprecated setup code


0.1.0 (2022)
0.0.6 (2023-08-18)
------------------
* Migrate package and build management to poetry
* Remove deprecated setup code

0.0.5 (2017-06-30)
------------------
Expand Down
2 changes: 1 addition & 1 deletion Dashboard/assets/bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Dashboard/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ body {

.Button {
color: blue;
}
}
1 change: 0 additions & 1 deletion Dashboard/assets/test.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ graft distill

# Exclude
global-exclude *.py[co]
global-exclude __pycache__
global-exclude __pycache__
30 changes: 29 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
.PHONY: test lint format
.PHONY: setup_precommit .cz.toml setup_commitizen commit publish_pytest test lint format

###################
# PRECOMMIT HOOKS #
###################

setup_precommit:
@echo "Setting up pre-commit hooks..."
poetry run pre-commit install
poetry run pre-commit autoupdate
@echo "Done."

setup_commitizen:
@echo "Installing commitizen for convential commits..."
pip install commitizen
cz init
@echo "Done."

commit:
@echo "Committing with commitizen..."
poetry run pre-commit run --all-files
poetry run cz commit
@echo "Done."

publish_pytest:
@echo "Publishing to Test PyPI..."
poetry build
poetry publish -r testpypi
@echo "Done."

###########
# Testing #
Expand Down
2 changes: 1 addition & 1 deletion distill/version.py → distill/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
and parsed by ``setup.py``.
"""

__version__ = "0.1.1"
version = "v0.0.6"
Loading

0 comments on commit 61af38d

Please sign in to comment.