Skip to content

Commit d58e329

Browse files
committed
Setup from EasyProjectTemplate
0 parents  commit d58e329

18 files changed

+792
-0
lines changed

.copier-answers.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: 1b51781
3+
_src_path: gh:/EasyScience/EasyProjectTemplate
4+
description: Core foundation of the EasyScience family of projects, providing the
5+
building blocks for libraries and applications
6+
max_python: '3.12'
7+
min_python: '3.8'
8+
orgname: EasyScience
9+
packagename: easyscience
10+
prettyname: Easyscience
11+
projectname: EasyScience
12+
year: 2024

.github/release-drafter.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# https://github.com/marketplace/actions/release-drafter
2+
name-template: v$NEXT_PATCH_VERSION 🌈
3+
tag-template: v$NEXT_PATCH_VERSION
4+
categories:
5+
- title: 🚀 Features
6+
labels:
7+
- feature
8+
- enhancement
9+
- title: 🐛 Bug Fixes
10+
labels:
11+
- fix
12+
- bugfix
13+
- bug
14+
- title: 🧰 Maintenance
15+
labels:
16+
- chore
17+
- documentation
18+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
19+
version-resolver:
20+
major:
21+
labels:
22+
- major
23+
minor:
24+
labels:
25+
- minor
26+
patch:
27+
labels:
28+
- patch
29+
default: patch
30+
template: |
31+
## Changes
32+
$CHANGES

.github/workflows/codeql-analysis.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This pipeline
2+
3+
name: "CodeQL"
4+
5+
on:
6+
push:
7+
branches: [ main, pre-release, develop ]
8+
pull_request:
9+
# The branches below must be a subset of the branches above
10+
branches: [ main ]
11+
schedule:
12+
- cron: '0 16 * * 5'
13+
14+
jobs:
15+
analyze:
16+
name: Analyze
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
# Override automatic language detection by changing the below list
23+
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
24+
language: ['python']
25+
# Learn more...
26+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
# We must fetch at least the immediate parents so that if this is
33+
# a pull request then we can checkout the head.
34+
fetch-depth: 2
35+
36+
# If this run was triggered by a pull request event, then checkout
37+
# the head of the pull request instead of the merge commit.
38+
- run: git checkout HEAD^2
39+
if: ${{ github.event_name == 'pull_request' }}
40+
41+
# Initializes the CodeQL tools for scanning.
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v3
44+
with:
45+
languages: ${{ matrix.language }}
46+
# If you wish to specify custom queries, you can do so here or in a config file.
47+
# By default, queries listed here will override any specified in a config file.
48+
# Prefix the list here with "+" to use these queries and those in the config file.
49+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
50+
51+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
52+
# If this step fails, then you should remove it and run the build manually (see below)
53+
- name: Autobuild
54+
uses: github/codeql-action/autobuild@v3
55+
56+
# ℹ️ Command-line programs to run using the OS shell.
57+
# 📚 https://git.io/JvXDl
58+
59+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
60+
# and modify them (or add more) to build your code if your project
61+
# uses a compiled language
62+
63+
#- run: |
64+
# make bootstrap
65+
# make release
66+
67+
- name: Perform CodeQL Analysis
68+
uses: github/codeql-action/analyze@v3
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This pipeline
2+
# - builds developer documentation
3+
# - pushes documentation to gh-pages branch of the same repository
4+
#
5+
# Deployment is handled by pages-build-deployment bot
6+
7+
name: Build Documentation and Push to gh-pages Branch
8+
9+
# Controls when the workflow will run
10+
on:
11+
# Triggers the workflow on tag creation
12+
push:
13+
tags:
14+
- 'v*'
15+
16+
# Allows you to run this workflow manually from the Actions tab
17+
workflow_dispatch:
18+
19+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
20+
jobs:
21+
# This workflow contains a single job called "build"
22+
build_documentation:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@master
27+
with:
28+
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
29+
- name: Upgrade pip
30+
run: |
31+
python -m pip install --upgrade pip
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: 3.9
36+
- name: Install Pandoc, EasyReflectometry and dependencies
37+
run: |
38+
sudo apt install pandoc
39+
pip install . '.[docs]'
40+
- name: Build and Commit
41+
uses: sphinx-notes/pages@master
42+
with:
43+
install_requirements: true
44+
documentation_path: docs
45+
- name: Push changes
46+
uses: ad-m/github-push-action@master
47+
continue-on-error: true
48+
with:
49+
branch: gh-pages

.github/workflows/ossar-analysis.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This workflow integrates a collection of open source static analysis tools
2+
# with GitHub code scanning. For documentation, or to provide feedback, visit
3+
# https://github.com/github/ossar-action
4+
name: OSSAR
5+
6+
on:
7+
pull_request:
8+
9+
jobs:
10+
OSSAR-Scan:
11+
# OSSAR runs on windows-latest.
12+
# ubuntu-latest and macos-latest support coming soon
13+
runs-on: windows-latest
14+
15+
steps:
16+
# Checkout your code repository to scan
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
# We must fetch at least the immediate parents so that if this is
21+
# a pull request then we can checkout the head.
22+
fetch-depth: 2
23+
24+
# If this run was triggered by a pull request event, then checkout
25+
# the head of the pull request instead of the merge commit.
26+
- run: git checkout HEAD^2
27+
if: ${{ github.event_name == 'pull_request' }}
28+
29+
# Ensure a compatible version of dotnet is installed.
30+
# The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201.
31+
# A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action.
32+
# Remote agents already have a compatible version of dotnet installed and this step may be skipped.
33+
# For local agents, ensure dotnet version 3.1.201 or later is installed by including this action:
34+
# - name: Install .NET
35+
# uses: actions/setup-dotnet@v1
36+
# with:
37+
# dotnet-version: '3.1.x'
38+
39+
# Run open source static analysis tools
40+
- name: Run OSSAR
41+
uses: github/ossar-action@v1
42+
id: ossar
43+
44+
# Upload results to the Security tab
45+
- name: Upload OSSAR results
46+
uses: github/codeql-action/upload-sarif@v3
47+
with:
48+
sarif_file: ${{ steps.ossar.outputs.sarifFile }}

.github/workflows/python-ci.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# This workflow will for a variety of Python versions
2+
# - install the code base
3+
# - lint the code base
4+
# - test the code base
5+
# - upload the test coverage to codecov
6+
#
7+
# It will also
8+
# - build the package
9+
# - check the package
10+
#
11+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
12+
13+
name: CI using pip
14+
15+
on: [push, pull_request]
16+
17+
jobs:
18+
Code_Consistency:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: chartboost/ruff-action@v1
23+
- name: Suggestion to fix issues
24+
if: ${{ failure() }}
25+
run: |
26+
echo "::notice::In project root run 'python.exe -m ruff . --fix' and commit changes to fix issues."
27+
exit 1
28+
29+
Code_Testing:
30+
strategy:
31+
max-parallel: 4
32+
matrix:
33+
python-version: ['3.9', '3.10', '3.11']
34+
os: [ubuntu-latest, macos-latest, windows-latest]
35+
36+
runs-on: ${{ matrix.os }}
37+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: actions/setup-python@v5
43+
with:
44+
python-version: ${{ matrix.python-version }}
45+
46+
- name: Install dependencies
47+
run: pip install -e '.[dev]'
48+
49+
- name: Test with tox
50+
run: |
51+
pip install tox tox-gh-actions coverage
52+
tox
53+
54+
- name: Upload coverage
55+
uses: codecov/codecov-action@v4
56+
with:
57+
name: Pytest coverage
58+
env_vars: OS,PYTHON,GITHUB_ACTIONS,GITHUB_ACTION,GITHUB_REF,GITHUB_REPOSITORY,GITHUB_HEAD_REF,GITHUB_RUN_ID,GITHUB_SHA,COVERAGE_FILE
59+
env:
60+
OS: ${{ matrix.os }}
61+
PYTHON: ${{ matrix.python-version }}
62+
63+
Package_Testing:
64+
65+
runs-on: ubuntu-latest
66+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
67+
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- uses: actions/setup-python@v5
72+
with:
73+
python-version: 3.9
74+
75+
- name: Install dependencies and build
76+
run: |
77+
pip install -e '.[dev]'
78+
python -m build
79+
80+
- name: Check Build
81+
run: |
82+
cd ./dist
83+
pytest ../

.github/workflows/python-package.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will for a variety of Python versions
2+
# - build a python package
3+
# - run tests on the produced package
4+
# - upload the package as an artifact
5+
#
6+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
7+
8+
name: Create Python Package
9+
10+
on:
11+
push:
12+
branches: [ main, pre-release ]
13+
pull_request:
14+
branches: [ main, pre-release ]
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
python-version: ['3.9', '3.10', '3.11']
22+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
- name: Install dependencies and build
31+
run: |
32+
pip install -e '.[dev]'
33+
python -m build
34+
- name: Test with pytest
35+
run: |
36+
cd ./dist
37+
pytest ../
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
name: Upload - Python ${{ matrix.python-version }}
41+
path: ${{ github.workspace }}/dist/*
42+
overwrite: true

.github/workflows/python-publish.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will
2+
# - build distribution package, pure python wheel
3+
# - publish produced distribution package to PyPI
4+
#
5+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
6+
7+
name: Publish Python Package
8+
9+
# Controls when the workflow will run
10+
on:
11+
# Triggers the workflow on tag creation
12+
push:
13+
tags:
14+
- 'v*'
15+
16+
# Allows you to run this workflow manually from the Actions tab
17+
workflow_dispatch:
18+
19+
jobs:
20+
deploy:
21+
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: 3.9
30+
31+
- name: Install dependencies and build
32+
run: |
33+
pip install -e '.[dev]'
34+
python -m build
35+
36+
- name: Publish distribution 📦 to PyPI
37+
uses: pypa/gh-action-pypi-publish@release/v1
38+
with:
39+
password: ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)