Skip to content

Commit

Permalink
chore: rerun boiler
Browse files Browse the repository at this point in the history
  • Loading branch information
m4tx committed Feb 4, 2024
1 parent dbb10ae commit 1b20c36
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 46 deletions.
9 changes: 5 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: 2

updates:
- package-ecosystem: cargo
directory: /
Expand All @@ -7,8 +8,8 @@ updates:
groups:
dependencies:
update-types:
- "minor"
- "patch"
- minor
- patch

- package-ecosystem: docker
directory: /
Expand All @@ -17,8 +18,8 @@ updates:
groups:
dependencies:
update-types:
- "minor"
- "patch"
- minor
- patch

- package-ecosystem: github-actions
directory: /
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Docker Images
name: Docker

on:
push:
pull_request:

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

jobs:
build-and-push-backend:
build-and-push-chombo-gen-backend:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -30,6 +20,7 @@ jobs:

- name: Log in to the Container registry
uses: docker/login-action@v3
if: github.ref == 'refs/heads/master'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -46,11 +37,11 @@ jobs:
with:
context: .
file: chombo-gen-backend.dockerfile
push: ${{ github.event_name == 'push' }}
push: ${{ github.ref == 'refs/heads/master' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-and-push-frontend:
build-and-push-chombo-gen-frontend:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -62,6 +53,7 @@ jobs:

- name: Log in to the Container registry
uses: docker/login-action@v3
if: github.ref == 'refs/heads/master'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -78,11 +70,11 @@ jobs:
with:
context: .
file: chombo-gen-frontend.dockerfile
push: ${{ github.event_name == 'push' }}
push: ${{ github.ref == 'refs/heads/master' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-and-push-proxy:
build-and-push-chombo-gen-proxy:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -94,6 +86,7 @@ jobs:

- name: Log in to the Container registry
uses: docker/login-action@v3
if: github.ref == 'refs/heads/master'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -110,6 +103,6 @@ jobs:
with:
context: .
file: chombo-gen-proxy.dockerfile
push: ${{ github.event_name == 'push' }}
push: ${{ github.ref == 'refs/heads/master' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
27 changes: 27 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pre-commit checks

on:
push:
pull_request:

jobs:
pre-commit:
# 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.pull_request.head.repo.full_name !=
github.repository

name: Linting Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Check files
uses: pre-commit/[email protected]
29 changes: 17 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Rust CI
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

env:
CARGO_TERM_COLOR: always
Expand All @@ -17,15 +19,16 @@ jobs:
build:
strategy:
matrix:
rust: ["stable", "beta", "nightly"]
os: [ubuntu-latest, macos-latest, windows-2019]
rust: [stable, nightly]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Cache Cargo registry
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
Expand All @@ -42,55 +45,57 @@ jobs:
run: cargo install trunk

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

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

- name: Build chombo-gen-frontend
- name: Build Trunk project chombo-gen-frontend
run: cd chombo-gen-frontend && trunk build

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

- name: Cache Cargo registry
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.toml') }}

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

- name: Run clippy
run: cargo clippy -- -Dclippy::all

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

- name: Cache Cargo registry
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.toml') }}

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

- name: Run fmt
Expand Down
33 changes: 23 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,33 @@
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
args: [ "--fix=lf" ]
- id: check-yaml
- id: check-added-large-files
args: [ "--maxkb=10000" ]
args: ["--fix=lf"]
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
types_or: [json, yaml]

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: cargo-check
args: [ "--all-targets" ]
- id: clippy
args: [ "--all-targets" ]

- repo: https://github.com/AleksaC/hadolint-py
rev: v2.12.0.3
hooks:
- id: hadolint
files: (Dockerfile|.dockerfile)$
types: [text]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
chombo-gen
==========

[![Rust CI Build Status](https://github.com/m4tx/chombo-gen/workflows/Rust%20CI/badge.svg)](https://github.com/m4tx/chombo-gen/actions/workflows/rust.yml)
[![Docker Images Build Status](https://github.com/m4tx/chombo-gen/workflows/Docker%20Images/badge.svg)](https://github.com/m4tx/chombo-gen/actions/workflows/docker.yml)
[![AGPL licensed](https://shields.io/github/license/m4tx/chombo-gen)](https://github.com/m4tx/chombo-gen/blob/master/LICENSE)
[![Rust Build Status](https://github.com/m4tx/chombo-gen/workflows/Rust%20CI/badge.svg)](https://github.com/m4tx/chombo-gen/actions/workflows/rust.yml)
[![Docker Build Status](https://github.com/m4tx/chombo-gen/workflows/Docker/badge.svg)](https://github.com/m4tx/chombo-gen/actions/workflows/docker-publish.yml)
[![GNU AGPL v3 licensed](https://img.shields.io/github/license/m4tx/chombo-gen)](https://github.com/m4tx/chombo-gen/blob/master/LICENSE)

ChomboGen is a web service that allows to generate images of Japanese (Riichi) Mahjong hands. The hands are provided in a text format and are generated in PNG format.

Expand Down

0 comments on commit 1b20c36

Please sign in to comment.