Skip to content

Commit

Permalink
Initial commit from Cookiecutter template
Browse files Browse the repository at this point in the history
  • Loading branch information
lfse-slafleur committed Jul 9, 2024
0 parents commit e4f219a
Show file tree
Hide file tree
Showing 45 changed files with 1,383 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/BuildTest_win32.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build-Test-Lint (win32)

on:
pull_request:
types: [ opened, reopened, synchronize ]

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.11"]
# python-version: [3.8, 3.9, 3.10, 3.11]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- run: |
.\ci\win32\create_venv.cmd
.\ci\win32\install_dependencies.cmd
- name: run unit tests
run: |
.\ci\win32\test_unit.cmd
- name: Lint
run: |
.\ci\win32\lint.cmd
112 changes: 112 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Build-Test-Lint-etc (linux)

on: [push]

jobs:

flake8-lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Check out source repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: flake8 Lint
uses: TrueBrain/actions-flake8@v2
with:
plugins: Flake8-pyproject==1.2.3 flake8-docstrings==1.7.0 flake8-quotes==3.3.2 flake8-bugbear==23.9.16 flake8-mock==0.4 flake8-tuple==0.4.1
# only_warn: 1 #causes action to always be succesful, but still provide annotations

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
# python-version: [3.8, 3.9, 3.10, 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- run: |
./ci/linux/create_venv.sh
./ci/linux/install_dependencies.sh
- name: run unit tests
run: |
./ci/linux/test_unit.sh
- name: Surface failing tests
if: always()
uses: pmeier/pytest-results-action@main
with:
# A list of JUnit XML files, directories containing the former, and wildcard
# patterns to process.
# See @actions/glob for supported patterns.
path: test-results.xml

# Add a summary of the results at the top of the report
# Default: true
summary: true

# Select which results should be included in the report.
# Follows the same syntax as
# `pytest -r`
# Default: fEX
display-options: fEX

# Fail the workflow if no JUnit XML was found.
# Default: true
fail-on-empty: true

typecheck:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
# python-version: [3.8, 3.9, 3.10, 3.11]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- run: |
./ci/linux/create_venv.sh
./ci/linux/install_dependencies.sh
- name: Add mypy annotator
uses: pr-annotators/mypy-pr-annotator@v1.0.0

- name: run typechecker
run: |
./ci/linux/typecheck.sh
build:
name: Build the python package
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11" ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- run: |
./ci/linux/create_venv.sh
./ci/linux/install_dependencies.sh
- name: build
run: |
./ci/linux/build_python_package.sh
72 changes: 72 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '22 6 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
28 changes: 28 additions & 0 deletions .github/workflows/publish_container_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deply to GitHub Container Registry
on:
push:
tags:
- v*.*

jobs:
publish-container-image:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build the container image
run: |
docker build . --tag ghcr.io/n/omotes_kpi_calculator:latest --tag ghcr.io/n/omotes_kpi_calculator:${{github.ref_name}}
docker push ghcr.io/n/omotes_kpi_calculator:latest
docker push ghcr.io/n/omotes_kpi_calculator:${{github.ref_name}}
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PyPi release
run-name: Releasing next version 🚀
on:
push:
tags:
- '*'

jobs:
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11" ]
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- run: |
./ci/linux/create_venv.sh
./ci/linux/update_dependencies.sh
./ci/linux/install_dependencies.sh
- name: build
run: |
./ci/linux/build_python_package.sh
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Loading

0 comments on commit e4f219a

Please sign in to comment.