Skip to content

Commit

Permalink
Merge pull request #8 from dtu-qmcm/ci
Browse files Browse the repository at this point in the history
Ci
  • Loading branch information
teddygroves authored Aug 16, 2024
2 parents 1107eb2 + f3e7bec commit c08c96c
Show file tree
Hide file tree
Showing 10 changed files with 308 additions and 34 deletions.
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

Checklist:

- [ ] tests pass
- [ ] `README.md` up to date
- [ ] docs up to date
- [ ] link to any relevant issues
26 changes: 26 additions & 0 deletions .github/workflows/count-lines-of-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Count Lines of Code

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
tags-ignore: '**'
pull_request:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
cloc:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Runs djdefi/cloc-action
- name: Count Lines of Code (cloc)
uses: djdefi/cloc-action@5
32 changes: 32 additions & 0 deletions .github/workflows/run_pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow runs tests using pytest.

name: Run pytest

on:
push:
branches:
- '**'
tags-ignore:
- '**'

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Install enzax
run: pip install -e .[test]
- name: Run pytest
run: python -m pytest --cov=src/enzax
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.0
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
144 changes: 141 additions & 3 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ license = {text = "MIT"}
test = [
"pytest>=8.3.2",
"pytest-cov>=5.0.0",
"pre-commit>=3.8.0",
]
[build-system]
requires = ["hatchling"]
Expand Down
Loading

0 comments on commit c08c96c

Please sign in to comment.