Initial commit
This commit is contained in:
commit
35981db036
12 changed files with 727 additions and 0 deletions
51
.github/workflows/ci.yaml
vendored
Normal file
51
.github/workflows/ci.yaml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
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
39
.github/workflows/release.yaml
vendored
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue