Skip to content

Commit

Permalink
Merge pull request #2 from TOMToolkit/feature/add_github_workflows
Browse files Browse the repository at this point in the history
copy workflows from tom_swift
  • Loading branch information
jchate6 authored Dec 14, 2023
2 parents 815f90a + ab30ee5 commit fefbef9
Show file tree
Hide file tree
Showing 9 changed files with 683 additions and 138 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2

updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
time: "13:00"
open-pull-requests-limit: 10
41 changes: 41 additions & 0 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create Github Release

on:
push:
tags:
- "*.*.*"
- "*.*.*-alpha.*"
- "*.*.*-beta.*"
- "*.*.*-rc.*"

jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install
- name: Run tests
run: echo "write tests!"

create_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
29 changes: 29 additions & 0 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release to PyPi

on:
release:
types: [published]

jobs:
publish_to_pypi:
runs-on: ubuntu-latest
environment: release # configured in repo Settings/Environments; referenced in PyPI OIDC
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Build package with poetry
run: |
poetry build -f wheel
poetry build -f sdist
- name: Publish to PyPI with pypi-publish (trusted publishing)
uses: pypa/[email protected]

38 changes: 38 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: run-tests

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install --with lint
- name: Style Checks
run: poetry run flake8 tom_* --exclude=*/migrations/* --max-line-length=120

run_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
poetry install
- name: Run tests
run: poetry run python -m unittest discover -v
692 changes: 559 additions & 133 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tom-tns"
version = "0.1.0"
version = "0.0.0"
description = "TOMtoolkit module for reporting transients to the TNS"
authors = ["Joseph Chatelain <[email protected]>"]
license = "GPL-3.0-or-later"
Expand All @@ -9,8 +9,10 @@ packages = [{include = "tom_tns"}]

[tool.poetry.dependencies]
python = "^3.8.1,<3.12"
tomtoolkit = "^2.14"
tomtoolkit = "^2.15"

[tool.poetry.group.lint.dependencies]
flake8 = "~6.0"

[tool.poetry-dynamic-versioning]
enable = true
Expand Down
2 changes: 1 addition & 1 deletion tom_tns/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.contrib import admin
# from django.contrib import admin

# Register your models here.
2 changes: 1 addition & 1 deletion tom_tns/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.db import models
# from django.db import models

# Create your models here.
2 changes: 1 addition & 1 deletion tom_tns/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from django.test import TestCase
# from django.test import TestCase

# Create your tests here.

0 comments on commit fefbef9

Please sign in to comment.