Skip to content

Commit

Permalink
CI: Add Initial GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
AvlWx2014 committed Sep 26, 2024
1 parent 51b39e7 commit 374327d
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
pull_request:
branches:
- main
- dev
paths-ignore:
- docs/
- "*.md"
push:
branches:
- main
paths-ignore:
- docs/
- "*.md"

concurrency:
group: ${{ github.event.number || github.run_id }}
cancel-in-progress: true

jobs:
StaticAnalysis:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Python (3.9)
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.9"
architecture: x64
- name: Install PDM
run: pip install setuptools wheel pdm
- name: Cache Venv
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: .venv
key: venv-${{ hashFiles('pdm.lock') }}
restore-keys: |
venv-
- name: Provision Environment
run: pdm sync -dG:all
if: steps.cache-venv.outputs.cache-hit != 'true'
- name: Lint
run: pdm lint-check
- name: Check Formatting
run: pdm format-check
- name: Type Check
run: pdm type-check
- name: Security Scan
run: pdm vuln-check

TestSuite:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Python (${{ matrix.python-version }})
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: pip
- name: Cache Venv
id: cache-venv
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: .venv
key: venv-${{ hashFiles('pdm.lock') }}
restore-keys: |
venv-
- name: Install PDM
run: pip install setuptools wheel pdm
- name: Provision Environment
run: pdm sync -dG:all
if: steps.cache-venv.outputs.cache-hit != 'true'
- name: Unit Tests
run: pdm test


23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
release-pypi:
name: Release (PyPI)
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install PDM
uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4.1
- name: Build Distribution(s)
run: pdm build --no-sdist
- name: Publish Distribution(s)
run: pdm publish --no-build

0 comments on commit 374327d

Please sign in to comment.