Skip to content

Commit

Permalink
chore: update files & change repo references
Browse files Browse the repository at this point in the history
  • Loading branch information
akatief committed Feb 9, 2024
1 parent a7fd98f commit 00247e5
Show file tree
Hide file tree
Showing 35 changed files with 622 additions and 668 deletions.
12 changes: 0 additions & 12 deletions .github/FUNDING.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/release_message.sh

This file was deleted.

10 changes: 5 additions & 5 deletions .github/rename_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ echo "Description: $description";

echo "Renaming project..."

original_author="author_name"
original_name="project_name"
original_urlname="project_urlname"
original_description="project_description"
original_author="UKPLab"
original_name="ukp-project-template"
original_urlname="ukp-project-template"
original_description="The official template for new Python projects at UKP Lab"
# for filename in $(find . -name "*.*")
for filename in $(git ls-files)
do
Expand All @@ -30,7 +30,7 @@ do
echo "Renamed $filename"
done

mv project_name $name
mv ukp_project_template $name

# This command runs only once on GHA!
rm -rf .github/template.yml
1 change: 0 additions & 1 deletion .github/template.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build Docs

on:
push:
branches:
- main # Change this to your main branch name
pull_request:
branches:
- main # Change this to your main branch name

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9 # Change this to your Python version

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Build Docs
run: |
python -m mkdocs build --verbose
135 changes: 69 additions & 66 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
Expand All @@ -14,79 +13,83 @@ on:
workflow_dispatch:

jobs:

check-files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check files
run: |
# Define the list of filenames you want to check
FILES_TO_CHECK=("LICENSE" "README.md" "requirements.txt" "requirements-dev.txt" "NOTICE.txt" "setup.py")
# Initialize a variable to track missing files
MISSING_FILES=()
# Check if each file exists in the root directory
for FILE in "${FILES_TO_CHECK[@]}"; do
if [ ! -f "$FILE" ]; then
MISSING_FILES+=("$FILE")
fi
done
# Output the missing files
if [ ${#MISSING_FILES[@]} -eq 0 ]; then
echo "All files exist."
else
echo "The following files are missing:"
for MISSING_FILE in "${MISSING_FILES[@]}"; do
echo "- $MISSING_FILE"
done
echo "::error::One or more files are missing."
exit 1
fi
linter:
strategy:
fail-fast: false
matrix:
python-version: [3.9]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
needs: check-files
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install project
run: make install
- name: Run linter
run: make lint
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install -r requirements-dev.txt
- name: Analysing the code with pylint
run: |
pylint --disable=trailing-whitespace,missing-class-docstring,missing-final-newline,trailing-newlines \
--fail-under=9.0 \
$(git ls-files '*.py') || echo "::warning::Pylint check failed, but the workflow will continue."
tests_linux:
needs: linter
tests:
needs: check-files
strategy:
fail-fast: false
matrix:
python-version: [3.9]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install project
run: make install
- name: Run tests
run: make test
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
# with:
# fail_ci_if_error: true
- name: Checkout repository
uses: actions/checkout@v4

tests_mac:
needs: linter
strategy:
fail-fast: false
matrix:
python-version: [3.9]
os: [macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install project
run: make install
- name: Run tests
run: make test
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install .
pip install -r requirements-dev.txt
tests_win:
needs: linter
strategy:
fail-fast: false
matrix:
python-version: [3.9]
os: [windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Pip
run: pip install --user --upgrade pip
- name: Install project
run: pip install -e .[test]
- name: run tests
run: pytest -s -vvvv -l --tb=long tests
- name: Run tests
run: |
pytest -v --cov-fail-under=60 --cov=ukp_project_template -l --tb=short --maxfail=1 tests/
50 changes: 0 additions & 50 deletions .github/workflows/release.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/rename_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ permissions: write-all

jobs:
rename-project:
if: ${{ !contains (github.repository, '/python-project-template') }}
if: ${{ !contains (github.repository, '/ukp-project-template') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# by default, it uses a depth of 1
# this fetches all history so that we can read each commit
Expand All @@ -35,7 +35,7 @@ jobs:
echo "Renaming the project with -a(author) ${{ env.REPOSITORY_OWNER }} -n(name) ${{ env.REPOSITORY_NAME }} -u(urlname) ${{ env.REPOSITORY_URLNAME }}"
.github/rename_project.sh -a ${{ env.REPOSITORY_OWNER }} -n ${{ env.REPOSITORY_NAME }} -u ${{ env.REPOSITORY_URLNAME }} -d "Awesome ${{ env.REPOSITORY_NAME }} created by ${{ env.REPOSITORY_OWNER }}"
- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "✅ Ready to clone and code."
# commit_options: '--amend --no-edit'
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This is a basic workflow to help you get started with Actions
name: Run tests

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install .
pip install -r requirements-dev.txt
- name: Run tests
run: |
pytest -v --cov-fail-under=60 --cov=ukp_project_template -l --tb=short --maxfail=1 tests/
coverage xml
coverage html
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ dmypy.json

# templates
.github/templates/*

# History
.history
Loading

0 comments on commit 00247e5

Please sign in to comment.