Skip to content

Commit fa63699

Browse files
authored
feat: Initial project structure (#1)
* feat: Initial project structure * feat: Updates after review
1 parent 2384de9 commit fa63699

24 files changed

Lines changed: 689 additions & 1 deletion

‎.github/dependabot.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "pip" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
12+
- package-ecosystem: "maven" # See documentation for possible values
13+
directory: "/data/local/test_basic/layout_maven/ms-101" # Location of package manifests
14+
schedule:
15+
interval: "daily"
16+
- package-ecosystem: "github-actions"
17+
directory: "/"
18+
schedule:
19+
interval: "daily"

‎.github/workflows/build.yml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build PyPI
2+
on:
3+
workflow_call:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
types:
8+
- opened
9+
- reopened
10+
- synchronize
11+
12+
jobs:
13+
linting:
14+
name: Reuse linting job
15+
uses: ./.github/workflows/lint.yml
16+
17+
build:
18+
needs: linting
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out source repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0 #full history
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.10"
29+
- name: Install dependencies
30+
run: pip install hatch
31+
- name: Run unit and integrations tests
32+
run: hatch run test:pytest --cov=reqstool-python-decorators --cov-report=xml --cov-report=html
33+
- name: Build project
34+
run: hatch build
35+
# Upload artifacts for later use
36+
- name: Upload Artifacts
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: dist
40+
path: dist/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Lint (black and flake8)
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
check-release:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check branch and tag
10+
if: github.event_name == 'push' && !(github.ref == 'refs/heads/main' && startsWith(github.ref, 'refs/tags/v'))
11+
run: exit 1

‎.github/workflows/lint.yml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Lint (black and flake8)
2+
on:
3+
workflow_dispatch:
4+
workflow_call:
5+
6+
jobs:
7+
linting:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out source repository
11+
uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.10"
16+
- name: Install pip package(s)
17+
run: pip install hatch
18+
- name: Run black formatter check
19+
run: hatch run lint:black --check --verbose src tests
20+
- name: Run flake8 linter
21+
run: hatch run lint:flake8
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to GitHub Pages
2+
on:
3+
workflow_dispatch:
4+
release:
5+
types: [created]
6+
push:
7+
branches:
8+
- main
9+
10+
concurrency:
11+
group: github-pages
12+
cancel-in-progress: false
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
jobs:
19+
publish_gh_pages:
20+
runs-on: ubuntu-latest
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
- name: Configure Pages
28+
uses: actions/configure-pages@v4
29+
- name: Install Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: "18"
33+
- name: Install Antora
34+
run: npm i antora
35+
- name: Install Asciidoctor Kroki extension
36+
run: npm i asciidoctor asciidoctor-kroki
37+
- name: Generate Site
38+
run: npx antora docs/antora-playbook.yml
39+
- name: Create site folders
40+
run: mkdir -p docs/build/site
41+
- name: Upload Artifacts
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: docs/build/site
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v4
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build and publish to PyPI
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
check-release:
9+
name: Reuse check release
10+
uses: ./.github/workflows/check_release.yml
11+
build:
12+
name: Reuse build
13+
uses: ./.github/workflows/build.yml
14+
15+
publish-to-pypi:
16+
needs:
17+
- check-release
18+
- build
19+
runs-on: ubuntu-latest
20+
environment:
21+
name: prod
22+
url: https://pypi.org/p/reqstool-python-hatch-plugin
23+
permissions:
24+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
25+
steps:
26+
# Download artifacts from the build job
27+
- name: Download Artifacts
28+
uses: actions/download-artifact@v4
29+
with:
30+
name: dist
31+
path: dist
32+
- name: Publish distribution 📦 to PyPI
33+
# if: startsWith(github.ref, 'refs/tags')
34+
uses: pypa/gh-action-pypi-publish@release/v1
35+
with:
36+
sign-artifacts: true
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build and publish to Test PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
name: Reuse build
9+
uses: ./.github/workflows/build.yml
10+
11+
publish-to-test-pypi:
12+
needs: build
13+
runs-on: ubuntu-latest
14+
# Specifying a GitHub environment is optional, but strongly encouraged
15+
environment:
16+
name: test
17+
url: https://test.pypi.org/p/reqstool-python-hatch-plugin
18+
permissions:
19+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
20+
steps:
21+
# Download artifacts from the build job
22+
- name: Download Artifacts
23+
uses: actions/download-artifact@v4
24+
with:
25+
name: dist
26+
path: dist
27+
- name: Publish distribution 📦 to Test PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
repository-url: https://test.pypi.org/legacy/
31+
sign-artifacts: true
32+
skip-existing: true

0 commit comments

Comments
 (0)