Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement #4

Merged
merged 15 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Empty file added .distro/fmf-jinja.rpmlintrc
Empty file.
47 changes: 47 additions & 0 deletions .distro/fmf-jinja.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Name: fmf-jinja
Version: 0.0.0
Release: %autorelease
Summary: Jinja template engine using FMF metadata

License: GPL-3.0-or-later
URL: https://github.com/LecrisUT/fmf-jinja
Source: %{pypi_source tmt_cmake}

BuildArch: noarch
BuildRequires: python3-devel

%py_provides python3-fmf-jinja

%description
Jinja template engine using FMF metadata


%prep
%autosetup -n fmf-jinja-%{version}


%generate_buildrequires
%pyproject_buildrequires -x test


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files fmf_jinja


%check
%pytest


%files -f %{pyproject_files}
%{_bindir}/fmf-jinja
%license LICENSE.md
%doc README.md


%changelog
%autochangelog
10 changes: 10 additions & 0 deletions .distro/plans/full.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
summary: All tmt tests
discover+:
how: fmf
path: .
execute:
how: tmt
prepare:
how: install
package:
- python3-pytest
4 changes: 4 additions & 0 deletions .distro/plans/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
adjust:
when: initiator is not defined or initiator != packit
discover+:
dist-git-source: true
10 changes: 10 additions & 0 deletions .distro/plans/rpminspect.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plan:
import:
url: https://github.com/packit/tmt-plans
ref: main
name: /plans/rpminspect
environment:
# upstream is excluded here because it triggers "Unexpected changed source archive content"
# This happens when the released version already contains the package version:
# https://github.com/packit/tmt-plans/issues/13
RPMINSPECT_EXCLUDE: metadata,upstream
5 changes: 5 additions & 0 deletions .distro/plans/rpmlint.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plan:
import:
url: https://github.com/packit/tmt-plans
ref: main
name: /plans/rpmlint
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
1 change: 0 additions & 1 deletion .git_archival.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
17 changes: 17 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"groupName": "CI and devDependencies",
"matchManagers": ["github-actions", "pre-commit"]
}
],
"separateMajorMinor": false,
"extends": [
"config:recommended",
":dependencyDashboard",
"schedule:weekly",
":enablePreCommit",
":semanticCommitTypeAll(chore)"
]
}
56 changes: 29 additions & 27 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
name: CI
run-name: >
CI (${{ github.event_name }})
${{ github.event_name == 'pull_request' && format('PR#{0}', github.event.number) || '' }}

on:
workflow_dispatch:
inputs:
upload-wheel:
type: boolean
required: false
default: false
description: Upload wheel as an artifact
pytest-flags:
type: string
required: false
description: Additional flags to add to pytest
pull_request:
push:
branches: [ main ]
schedule:
- cron: 0 0 * * 3

permissions:
contents: read
Expand All @@ -31,32 +26,39 @@ jobs:
needs: [ pre-commit ]
uses: ./.github/workflows/step_test.yaml
with:
pytest-flags: ${{ inputs.pytest-flags }}
mask-experimental: ${{ github.event_name == 'push' }}

code-analysis:
uses: ./.github/workflows/step_code-analysis.yaml
coverage:
name: 👀 coverage
needs: [ tests ]
uses: ./.github/workflows/step_coverage.yaml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: github.event_name != 'schedule'

docs:
name: 📘 docs
needs: [ pre-commit ]
uses: ./.github/workflows/step_docs.yaml

build:
needs: [ pre-commit ]
uses: ./.github/workflows/step_build.yaml

static-analysis:
needs: [ pre-commit ]
uses: ./.github/workflows/step_static-analysis.yaml
secrets:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
permissions:
security-events: write
contents: write
checks: write
pull-requests: write

build-wheel:
uses: ./.github/workflows/step_build-wheel.yaml
needs: [ tests ]
with:
upload: ${{ inputs.upload-wheel || false }}
if: github.event_name != 'schedule'

pass:
name: Pass
needs: [ pre-commit, tests, build-wheel, code-analysis ]
name: Pass
needs: [ pre-commit, tests, coverage, docs, build, static-analysis ]
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
allowed-skips: code-analysis
allowed-skips: coverage, static-analysis
jobs: ${{ toJSON(needs) }}
if: always()
19 changes: 9 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
name: Prepare release
name: 🚀 Release
run-name: >
🚀 Release
${{ github.ref_name }}

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"

permissions:
contents: read

jobs:
tests:
uses: ./.github/workflows/step_test.yaml
build-wheel:
needs: [ tests ]
uses: ./.github/workflows/step_build-wheel.yaml
uses: ./.github/workflows/step_build.yaml
upload_pypi:
name: Upload to PyPI repository
needs: [ tests, build-wheel ]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/spglib/
url: https://pypi.org/project/fmf-jinja/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
name: Packages
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -37,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: softprops/action-gh-release@v1
- uses: softprops/action-gh-release@v2
with:
name: FMF-Jinja ${{ github.ref_name }}
draft: true
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/step_build-wheel.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/step_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
workflow_call:

permissions:
contents: read

jobs:
build:
name: 🐍 sdist/wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2
32 changes: 0 additions & 32 deletions .github/workflows/step_code-analysis.yaml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/step_coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 👀 coverage

on:
workflow_call:
secrets:
CODECOV_TOKEN:
description: Codecov token of the main repository
required: false

permissions:
contents: read

jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install package
run: pip install -e .[test-cov]
- name: Test package
run: pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/step_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
workflow_call:

permissions:
contents: read

jobs:
sphinx:
name: Sphinx (${{ matrix.builder }})
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
builder: [ linkcheck, html ]
include:
# Run default html builder with warnings as error
- builder: html
args: -W
# TODO: warnings builder is experimental due to missing sphinx-autodoc support
# https://github.com/sphinx-doc/sphinx/issues/9813
# https://github.com/sphinx-doc/sphinx/issues/11991
experimental: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
- name: Install the project and docs dependencies
run: pip install -e .[docs]
- name: Run sphinx builder ${{ matrix.builder }}
run: sphinx-build -b ${{ matrix.builder }} ${{ matrix.args }} ./docs ./docs/_build
6 changes: 2 additions & 4 deletions .github/workflows/step_pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: pre-commit

on:
workflow_call:

Expand All @@ -12,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1
Loading
Loading