mirror of
https://github.com/maciejpedzich/f1-game-packet-parser.git
synced 2025-04-12 00:21:11 +02:00
ci: add CI/CD GitHub workflows and issue templates
This commit is contained in:
parent
ddda64768e
commit
4dede00b1f
30
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
30
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
**Description**
|
||||||
|
A description of what the bug is.
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
A [minimal reproducible code example](https://stackoverflow.com/help/minimal-reproducible-example) where the bug happens.
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A description of what you expected to happen.
|
||||||
|
|
||||||
|
**Actual behavior**
|
||||||
|
A description of what actually happens.
|
||||||
|
|
||||||
|
**Environment**
|
||||||
|
- OS: [e.g. Windows/MacOS/Linux]
|
||||||
|
- Rust version: [e.g. 1.78.0]
|
||||||
|
- Crate version: [e.g. 1.0.0]
|
||||||
|
- F1 game [F1 24/23/22]
|
||||||
|
- Platform [PC/Xbox/PlayStation]
|
||||||
|
- Packet format [2024/2023/2022]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Any other context about the bug here.
|
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
19
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: enhancement
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
**Problem**
|
||||||
|
A description of what is the problem that can be fixed with the feature you propose.
|
||||||
|
|
||||||
|
**Feature**
|
||||||
|
A description of the feature you propose.
|
||||||
|
|
||||||
|
**Examples**
|
||||||
|
One or more code examples that shows the feature in action.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Any other context about the feature request here.
|
36
.github/dependabot.yaml
vendored
Normal file
36
.github/dependabot.yaml
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Dependabot
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: cargo
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
day: friday
|
||||||
|
allow:
|
||||||
|
- dependency-type: all
|
||||||
|
groups:
|
||||||
|
patch-updates:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
update-types:
|
||||||
|
- "patch"
|
||||||
|
minor-updates:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
update-types:
|
||||||
|
- "minor"
|
||||||
|
major-updates:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
update-types:
|
||||||
|
- "major"
|
||||||
|
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
groups:
|
||||||
|
github-actions-updates:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
35
.github/workflows/cargo_deny.yaml
vendored
Normal file
35
.github/workflows/cargo_deny.yaml
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# Check for licenses and advisores
|
||||||
|
# ../../deny.toml
|
||||||
|
name: Cargo Deny
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cargo-deny:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Fetch Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install stable toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
|
||||||
|
- name: Cargo deny
|
||||||
|
uses: EmbarkStudios/cargo-deny-action@v2
|
||||||
|
|
||||||
|
cargo-audit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Fetch Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install stable toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
|
||||||
|
- uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: cargo-audit
|
||||||
|
|
||||||
|
- run: cargo audit
|
58
.github/workflows/cd.yaml
vendored
Normal file
58
.github/workflows/cd.yaml
vendored
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
name: Release-plz
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
# Release unpublished packages.
|
||||||
|
release-plz-release:
|
||||||
|
name: Release-plz release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
- name: Run release-plz
|
||||||
|
uses: release-plz/action@v0.5
|
||||||
|
with:
|
||||||
|
command: release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
# Create a PR with the new versions and changelog, preparing the next release.
|
||||||
|
release-plz-pr:
|
||||||
|
name: Release-plz PR
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
concurrency:
|
||||||
|
group: release-plz-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
- name: Run release-plz
|
||||||
|
uses: release-plz/action@v0.5
|
||||||
|
with:
|
||||||
|
command: release-pr
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
39
.github/workflows/check_msrv.yaml
vendored
Normal file
39
.github/workflows/check_msrv.yaml
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
name: Check MSRV
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-msrv:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Fetch Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install stable toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
|
||||||
|
- uses: cargo-bins/cargo-binstall@main
|
||||||
|
|
||||||
|
- name: Install cargo-msrv
|
||||||
|
uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: cargo-msrv
|
||||||
|
|
||||||
|
- name: Get current msrv
|
||||||
|
id: data-msrv
|
||||||
|
run: |
|
||||||
|
current_msrv=$(cargo msrv show --output-format minimal);
|
||||||
|
echo "current msrv: $current_msrv";
|
||||||
|
echo "current=$current_msrv" >> "$GITHUB_OUTPUT";
|
||||||
|
|
||||||
|
- name: Run cargo msrv
|
||||||
|
run: cargo msrv verify --min ${{ steps.data-msrv.outputs.current }}
|
||||||
|
|
||||||
|
- name: echo msrv info
|
||||||
|
if: failure()
|
||||||
|
run: |-
|
||||||
|
echo "current msrv: ${{ steps.data-msrv.outputs.current }}";
|
||||||
|
new_msrv=$(cargo msrv show --output-format minimal);
|
||||||
|
echo "new msrv: $new_msrv";
|
81
.github/workflows/ci.yaml
vendored
Normal file
81
.github/workflows/ci.yaml
vendored
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
name: "CI"
|
||||||
|
|
||||||
|
on:
|
||||||
|
merge_group:
|
||||||
|
workflow_dispatch:
|
||||||
|
workflow_call:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
clippy:
|
||||||
|
name: Cargo Clippy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Fetch Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install stable toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
components: clippy
|
||||||
|
|
||||||
|
- name: Clippy check
|
||||||
|
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings
|
||||||
|
|
||||||
|
rustfmt:
|
||||||
|
name: Rustfmt
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Fetch Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install stable toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
components: rustfmt
|
||||||
|
|
||||||
|
- name: Rustfmt check
|
||||||
|
run: cargo fmt --all --check
|
||||||
|
|
||||||
|
test-suite:
|
||||||
|
name: Test Suite
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Fetch Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install stable toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: cargo test --workspace --all-features
|
||||||
|
|
||||||
|
docs:
|
||||||
|
name: Docs
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Fetch Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install stable toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
|
||||||
|
- name: Check documentation
|
||||||
|
env:
|
||||||
|
RUSTDOCFLAGS: -D warnings
|
||||||
|
run: cargo doc --workspace --all-features
|
||||||
|
|
||||||
|
cargo-deny:
|
||||||
|
uses: ./.github/workflows/cargo_deny.yaml
|
||||||
|
|
||||||
|
check-msrv:
|
||||||
|
uses: ./.github/workflows/check_msrv.yaml
|
@ -7,7 +7,7 @@ This is a Rust crate that allows you to convert binary data from F1 24, F1 23, a
|
|||||||
Add `f1-game-packet-parser` to your project by running this command:
|
Add `f1-game-packet-parser` to your project by running this command:
|
||||||
|
|
||||||
```
|
```
|
||||||
cargo add f1_game_packet_parser
|
cargo add f1-game-packet-parser
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
Loading…
x
Reference in New Issue
Block a user