Initial commit
This commit is contained in:
88
.gitea/workflows/main.yml
Normal file
88
.gitea/workflows/main.yml
Normal file
@@ -0,0 +1,88 @@
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: CI
|
||||
|
||||
# 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:
|
||||
linter:
|
||||
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 linter
|
||||
run: make lint
|
||||
|
||||
tests_linux:
|
||||
needs: linter
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
52
.gitea/workflows/release.yml
Normal file
52
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
name: Upload Python Package
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
push:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
# by default, it uses a depth of 1
|
||||
# this fetches all history so that we can read each commit
|
||||
fetch-depth: 0
|
||||
- name: Generate Changelog
|
||||
run: .gitea/release_message.sh > release_message.md
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
body_path: release_message.md
|
||||
|
||||
# deploy:
|
||||
# needs: release
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# - name: Set up Python
|
||||
# uses: actions/setup-python@v4
|
||||
# with:
|
||||
# python-version: '3.x'
|
||||
# - name: Install dependencies
|
||||
# run: |
|
||||
# python -m pip install --upgrade pip
|
||||
# pip install setuptools wheel twine
|
||||
# - name: Build and publish
|
||||
# env:
|
||||
# TWINE_USERNAME: __token__
|
||||
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
||||
# run: |
|
||||
# python setup.py sdist bdist_wheel
|
||||
# twine upload dist/*
|
||||
42
.gitea/workflows/rename_project.yml
Normal file
42
.gitea/workflows/rename_project.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Rename the project from template
|
||||
|
||||
on: [push]
|
||||
|
||||
permissions: write-all
|
||||
|
||||
jobs:
|
||||
rename-project:
|
||||
if: ${{ !endsWith (github.repository, 'Templates/Python') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
# by default, it uses a depth of 1
|
||||
# this fetches all history so that we can read each commit
|
||||
fetch-depth: 0
|
||||
ref: ${{ gitea.head_ref }}
|
||||
|
||||
- run: echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}' | tr '-' '_' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- run: echo "REPOSITORY_URLNAME=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $2}')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- run: echo "REPOSITORY_OWNER=$(echo "$GITHUB_REPOSITORY" | awk -F '/' '{print $1}')" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Is this still a template
|
||||
id: is_template
|
||||
run: echo "::set-output name=is_template::$(ls .gitea/template.yml &> /dev/null && echo true || echo false)"
|
||||
|
||||
- name: Rename the project
|
||||
if: steps.is_template.outputs.is_template == 'true'
|
||||
run: |
|
||||
echo "Renaming the project with -a(author) ${{ env.REPOSITORY_OWNER }} -n(name) ${{ env.REPOSITORY_NAME }} -u(urlname) ${{ env.REPOSITORY_URLNAME }}"
|
||||
.gitea/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
|
||||
with:
|
||||
commit_message: "✅ Ready to clone and code."
|
||||
# commit_options: '--amend --no-edit'
|
||||
push_options: --force
|
||||
26
.gitea/workflows/sonar.yml
Normal file
26
.gitea/workflows/sonar.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
name: SonarQube Scan
|
||||
jobs:
|
||||
sonarqube:
|
||||
name: SonarQube Trigger
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checking out
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# Disabling shallow clone is recommended for improving relevancy of reporting
|
||||
fetch-depth: 0
|
||||
- name: SonarQube Scan
|
||||
uses: sonarsource/sonarqube-scan-action@master
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||
with:
|
||||
args: >
|
||||
-Dsonar.projectKey=project_name
|
||||
Reference in New Issue
Block a user