Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
target/
*.sqlite3
*.sqlite3-journal
.git/
.idea/
31 changes: 31 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2

updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: monthly
groups:
dependencies:
update-types:
- minor
- patch

- package-ecosystem: docker
directory: /
schedule:
interval: monthly
groups:
dependencies:
update-types:
- minor
- patch

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
groups:
dependencies:
patterns:
- "*"
42 changes: 42 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docker Images

on:
push:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
116 changes: 116 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Rust CI

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0

# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
# This will ensure that only one commit will be running tests at a time on each PR.
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
build:
# Run on external PRs and pushes to branches on the repo
# This is to avoid double running on PRs from internal branches
if: github.event_name == 'push' || github.event_name == 'schedule' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
rust: [stable, nightly]
os: [ubuntu-latest]

name: Build & test
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}

- name: Cache Cargo registry
uses: Swatinem/rust-cache@v2

- name: Build
run: cargo +${{ matrix.rust }} build

- name: Test docs
run: cargo +${{ matrix.rust }} test

clippy:
if: github.event_name == 'push' || github.event_name == 'schedule' || github.event.pull_request.head.repo.full_name != github.repository

name: Clippy lint checks
runs-on: ubuntu-latest
needs: ["build"]
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy

- name: Cache Cargo registry
uses: Swatinem/rust-cache@v2

- name: Run clippy
run: cargo clippy --no-deps --

rustfmt:
if: github.event_name == 'push' || github.event_name == 'schedule' || github.event.pull_request.head.repo.full_name != github.repository

name: Code formatting checks
runs-on: ubuntu-latest
needs: ["build"]
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt

- name: Cache Cargo registry
uses: Swatinem/rust-cache@v2

- name: Run fmt
run: cargo fmt --all -- --check

machete:
if: github.event_name == 'push' || github.event_name == 'schedule' || github.event.pull_request.head.repo.full_name != github.repository

name: Machete dependencies checks
runs-on: ubuntu-latest
needs: ["build"]
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Cache Cargo registry
uses: Swatinem/rust-cache@v2

- name: Run cargo-machete
uses: bnjbvr/cargo-machete@v0.8.0
120 changes: 15 additions & 105 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,110 +1,20 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
production_settings.py
db.sqlite3

# Compiled files
static_root/
generated/
game/static/scss/*.css

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject
# These are backup files generated by rustfmt
**/*.rs.bk

# Rope project settings
.ropeproject
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# mkdocs documentation
/site
# Test databases
*.db
*.sqlite3
*.sqlite3-journal

# mypy
.mypy_cache/
# Python asset-generator tooling
tools/output/
tools/.venv/
**/__pycache__/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "bootstrap"]
path = bootstrap
url = https://github.com/twbs/bootstrap.git
42 changes: 42 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
autofix_commit_msg: "chore(pre-commit.ci): auto fixes from pre-commit hooks"
autoupdate_commit_msg: "chore(pre-commit.ci): pre-commit autoupdate"
autoupdate_schedule: "monthly"
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-toml
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace

- repo: https://github.com/google/yamlfmt
rev: v0.17.2
hooks:
- id: yamlfmt
types_or: [json, yaml]

- repo: local
hooks:
- id: fmt
name: cargo fmt
files: ^.*\.(rs|toml)$
language: rust
entry: cargo fmt
pass_filenames: false

- repo: https://github.com/AleksaC/hadolint-py
rev: v2.12.1b3
hooks:
- id: hadolint
files: (Dockerfile|.dockerfile)$
types: [text]
Loading
Loading