Initial commit

This commit is contained in:
davidon-top 2023-12-08 20:12:52 +00:00 committed by GitHub
commit 8afbd6324d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 1406 additions and 0 deletions

55
.github/workflows/ci.yaml vendored Normal file
View file

@ -0,0 +1,55 @@
name: CI
on:
push:
branches:
- 'main'
- 'feat/*'
pull_request:
branches:
- 'main'
- 'feat/*'
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Run cargo test
run: cargo test
clippy_check:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- name: Run clippy
run: cargo clippy -- -D warnings
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check

39
.github/workflows/release.yaml vendored Normal file
View file

@ -0,0 +1,39 @@
name: Release
on:
push:
tags:
- '*'
env:
binary: rust-template
jobs:
release-linux:
runs-on: ubuntu-latest
steps:
- uses: olegtarasov/get-tag@v2.1.2
id: get_version
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
targets: x86_64-unknown-linux-gnu
- name: Build
run: |
cargo build --release --target x86_64-unknown-linux-gnu
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v3
with:
path: target/x86_64-unknown-linux-gnu/release/${{ env.binary }}
name: ${{ env.binary }}
retention-days: 1
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.binary }}
asset_name: ${{ env.binary }}-linux-${{ steps.get_version.outputs.tag }}
tag: ${{ github.ref }}
overwrite: true