Skip to content

Commit

Permalink
📈 Add CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Oct 10, 2024
1 parent f20d3f8 commit 5eb3c03
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Clippy

on:
pull_request:
paths:
- '.github/workflows/clippy.yml'
- 'yuuka/**/*'
- 'yuuka-macros/**/*'
- 'Cargo.toml'
- 'Cargo.lock'
push:
branches: [master]

jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- nightly

steps:
- uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy

- uses: Swatinem/rust-cache@v2

- name: Run clippy
run: |
cargo clippy \
--all-targets \
--all-features \
--workspace \
-- -D warnings
28 changes: 28 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Format
on:
pull_request:
paths:
- '.github/workflows/clippy.yml'
- 'yuuka/**/*'
- 'yuuka-macros/**/*'
- 'Cargo.toml'
- 'Cargo.lock'
push:
branches: [master]

jobs:
format:
name: Format
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Run fmt
run: cargo +nightly fmt --all -- --check --unstable-features
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish docker image
on:
push:
tags: [v*]

jobs:
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: cargo-release Cache
id: cargo_release_cache
uses: actions/cache@v3
with:
path: ~/.cargo/bin/cargo-release
key: ${{ runner.os }}-cargo-release

- run: cargo install cargo-release
if: steps.cargo_release_cache.outputs.cache-hit != 'true'

- run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }}

- run: |-
cargo release \
publish \
--workspace \
--all-features \
--allow-branch HEAD \
--no-confirm \
--no-verify \
--execute
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Clippy

on:
pull_request:
paths:
- '.github/workflows/clippy.yml'
- 'yuuka/**/*'
- 'yuuka-macros/**/*'
- 'Cargo.toml'
- 'Cargo.lock'
push:
branches: [master]

jobs:
clippy:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- nightly

steps:
- uses: actions/checkout@v4

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

- uses: Swatinem/rust-cache@v2

- name: Run unit test
run: |
cargo test \
--all-targets \
--all-features \
--workspace \
--no-fail-fast
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024 [name of copyright owner]
Copyright 2024 [langyo]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<img src="splash.png" alt="yuuka" />

![GitHub License](https://img.shields.io/github/license/celestia-island/yuuka)
![Crates.io License](https://img.shields.io/crates/l/yuuka)
[![Crates.io Version](https://img.shields.io/crates/v/yuuka)](https://docs.rs/yuuka)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/celestia-island/yuuka/test.yml)

## Introduction

Expand Down Expand Up @@ -56,6 +57,6 @@ let config = GameDevelopment {
- [x] Anonymous struct support that can use `auto!` macro to confirm the auto-generated field name
- [x] Default value support that can use `=` to assign the default value
- [x] `pub` and `pub(crate)` identifier support
- [ ] Support custom derive macro.
- [x] Support custom derive macro.
- [ ] Write a homepage for this library
- [x] Upload to `crates.io`

0 comments on commit 5eb3c03

Please sign in to comment.