-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into batch-dependency-updates
- Loading branch information
Showing
6 changed files
with
75 additions
and
113 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Lints | ||
|
||
on: [ pull_request, merge_group ] | ||
|
||
jobs: | ||
check: | ||
name: Cargo Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions-rust-lang/[email protected] | ||
with: | ||
toolchain: 1.76.0 | ||
- uses: olix0r/cargo-action-fmt/[email protected] | ||
- run: cargo check -q --message-format=json | cargo-action-fmt | ||
|
||
rustfmt: | ||
name: rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions-rust-lang/[email protected] | ||
with: | ||
# we have to use nightly since come important options are not stable yet | ||
toolchain: nightly | ||
components: rustfmt | ||
- name: Rustfmt Check | ||
uses: actions-rust-lang/[email protected] | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions-rust-lang/[email protected] | ||
with: | ||
toolchain: 1.76.0 | ||
components: clippy | ||
- uses: auguwu/[email protected] | ||
with: | ||
token: ${{secrets.GITHUB_TOKEN}} | ||
|
||
doc: | ||
name: Doc | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions-rust-lang/[email protected] | ||
with: | ||
toolchain: 1.76.0 | ||
- uses: olix0r/cargo-action-fmt/[email protected] | ||
- run: cargo doc --no-deps --message-format=json | cargo-action-fmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,49 +9,24 @@ jobs: | |
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/[email protected] | ||
with: | ||
toolchain: stable | ||
|
||
- name: Prepare Crate | ||
uses: actions-rs/[email protected] | ||
- uses: actions/[email protected] | ||
- uses: actions-rust-lang/[email protected] | ||
with: | ||
command: package | ||
|
||
- name: Login to crates.io | ||
uses: actions-rs/[email protected] | ||
with: | ||
command: login | ||
args: ${{ secrets.CARGO_TOKEN }} | ||
|
||
- name: Publish Crate | ||
uses: actions-rs/[email protected] | ||
with: | ||
command: publish | ||
toolchain: 1.76.0 | ||
- run: cargo publish | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_PUBLISH_TOKEN }} | ||
|
||
dockerize: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/[email protected] | ||
- name: Set environment | ||
run: echo "docker_image_tag=${GITHUB_REF##*/v}" >> $GITHUB_ENV | ||
|
||
- uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- uses: docker/[email protected] | ||
with: | ||
push: true | ||
|
@@ -78,34 +53,16 @@ jobs: | |
artifact-name: mc-server-pinger-darwin-x86_64 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/[email protected] | ||
- uses: actions/[email protected] | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
toolchain: 1.76.0 | ||
target: ${{ matrix.target }} | ||
override: true | ||
|
||
- name: Build | ||
uses: actions-rs/[email protected] | ||
with: | ||
command: build | ||
args: --release --target ${{ matrix.target }} | ||
- run: cargo build --release --target ${{ matrix.target }} | ||
|
||
- name: Move binary | ||
run: mv target/${{ matrix.target }}/release/${{ matrix.binary-name }} ${{ matrix.artifact-name }} | ||
|
||
- name: Strip binary | ||
run: strip ${{ matrix.artifact-name }} | ||
|
||
- name: Generate checksum | ||
run: shasum -a 256 ${{ matrix.artifact-name }} > ${{ matrix.artifact-name }}.sha256 | ||
|
||
|
@@ -116,4 +73,3 @@ jobs: | |
file: mc-server-pinger-* | ||
file_glob: true | ||
tag: ${{ github.ref }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,14 @@ | ||
name: Test | ||
|
||
on: [ workflow_dispatch, push, pull_request ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
on: [ push, merge_group ] | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- uses: actions-rs/[email protected] | ||
with: | ||
toolchain: stable | ||
|
||
- uses: actions-rs/[email protected] | ||
- uses: actions/[email protected] | ||
- uses: actions-rust-lang/[email protected] | ||
with: | ||
command: test | ||
args: --verbose | ||
toolchain: 1.76.0 | ||
- run: cargo test --all-features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ name = "mc-server-pinger" | |
version = "0.1.0-alpha.6" | ||
authors = ["Petr Portnov <[email protected]>"] | ||
edition = "2018" | ||
rust-version = "1.76.0" | ||
# Basic properties | ||
description = "Command line utility for pinging Minecraft servers via Server List Ping protocol" | ||
license = "Apache-2.0" | ||
|
@@ -24,8 +25,9 @@ peg = "0.8.2" | |
# This allows a better optimized binary at cost of more complicated compilation | ||
# which is fine and worth it | ||
lto = true | ||
# This minimizes build parallelization bu allows better optimizations | ||
# This minimizes build parallelization but allows better optimizations | ||
codegen-units = 1 | ||
# This is a single-purpose binary which has no space for panic | ||
# thus even if it (somehow) makes it way to production is not as critical | ||
panic = "abort" | ||
strip = true |