Skip to content

Commit

Permalink
[MISC] Update GH workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
ppfeufer committed Dec 27, 2023
1 parent 3e70b6f commit 16bb12d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/automated-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,34 @@ on:
- '**'

jobs:
# pre-commit Checks
# Run pre-commit Checks
pre-commit:
name: Pre Commit Checks
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v4

# Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml' # Read the Python version from the pyproject.toml file

# Install pre-commit
- name: Run Pre Commit Checks
uses: pre-commit/[email protected]

# Run Test Coverage
test-coverage-aa-stable:
test-coverage:
needs: [pre-commit]
name: AA Latest (Python ${{ matrix.python-version }} with ${{ matrix.database }})
runs-on: ubuntu-latest

strategy:
# Set Python and Django version to test for the stable release of AllianceAuth
# Set Python versions to test against
matrix:
python-version:
- '3.8'
Expand All @@ -61,8 +64,9 @@ jobs:
- mariadb:11.0 # Maintained until: June 2024
- mariadb:11.1 # Maintained until: August 2024

# continue-on-error: ${{ matrix.python-version == '3.11-dev' }}
# continue-on-error: ${{ matrix.python-version == '3.12' }}

# Set up services
services:
database:
image: ${{ matrix.database }}
Expand All @@ -74,34 +78,40 @@ jobs:
options: --tmpfs /var/lib/mysql

steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v4

# Install redis
- name: Install redis
run: sudo apt-get install -y redis-tools redis-server

# Verify that redis is up
- name: Verify that redis is up
run: redis-cli ping

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

# Install Tox and any other packages
- name: Install Tox and any other packages
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
# Run Tox with the specified environment
- name: Run Tox
env:
TOX_ENV: allianceauth-latest
DB_HOST: 127.0.0.1
DB_USER: root
DB_PASSWORD: temp_password_aa_tox_tests
# Run tox using the version of Python in `PATH`
run: tox -v -e ${{ env.TOX_ENV }}

# Upload coverage to Codecov
- name: Upload Coverage
if: ${{
(
Expand All @@ -125,33 +135,38 @@ jobs:
# fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

# Pypi Build Test
# Run PyPi Build Test
pypi-build-test:
needs: [ test-coverage-aa-stable ]
needs: [ test-coverage ]
name: PyPi Build Test
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v4

# Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml' # Read the Python version from the pyproject.toml file

# Install Tools
- name: Install Tools
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
python -m pip install --upgrade setuptools wheel
# Build Package
- name: Package Build
env:
STACKMANAGER_VERSION: 9999
run: |
python -m build
# Upload Build Artifacts
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/potential-duplicates.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Check potential duplicates when an issue is opened or edited.
#
# https://github.com/wow-actions/potential-duplicates

name: Potential Duplicates
Expand All @@ -9,6 +11,7 @@ on:
jobs:
run:
runs-on: ubuntu-latest

steps:
- uses: wow-actions/potential-duplicates@v1
with:
Expand All @@ -25,7 +28,7 @@ jobs:
state: all
# If similarity is higher than this threshold([0,1]), issue will be marked as duplicate.
threshold: 0.6
# Reactions to be add to comment when potential duplicates are detected.
# Reactions to be added to comment when potential duplicates are detected.
# Available reactions: "-1", "+1", "confused", "laugh", "heart", "hooray", "rocket", "eyes"
reactions: 'eyes, confused'
# Comment to post when potential duplicates are detected.
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,29 @@ on:

jobs:
release:
# Release to PyPI
name: Release on Pypi
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v4

# Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml' # Read the Python version from the pyproject.toml file

# Install Tools
- name: Install Tools
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
python -m pip install --upgrade setuptools wheel twine
# Package and Upload
- name: Package and Upload
env:
STACKMANAGER_VERSION: ${{ github.event.release.tag_name }}
Expand Down

0 comments on commit 16bb12d

Please sign in to comment.