GitHub Actions: run clippy, fmt; remove other CI (#365)

Consolidates the multitude of CI systems, replacing Azure, SourceHut, and
AppVeyor with GitHub Actions, which now also runs clippy and fmt. See #352

* Add task to run clippy

* Add task to check formatting

* Test on 1.44.1 toolchain

* Update readme: status badge and downloads on GitHub Actions

* Remove strip binary task, leave it unstripped to allow debugging for now

* Rename task to install dependencies

* Remove Azure Pipelines

* Remove sr.ht SourceHut CI

* Remove AppVeyor
This commit is contained in:
ice_iix 2020-07-05 12:14:37 -07:00
parent dbca7464bd
commit 7869893038
5 changed files with 14 additions and 96 deletions

View File

@ -1,20 +0,0 @@
image: ubuntu/latest
packages:
- curl
- libegl1-mesa-dev
- libgles2-mesa-dev
- pkg-config
- libssl-dev
sources:
- https://github.com/iceiix/stevenarella
tasks:
- setup: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
sh ./rustup.sh -y
source $HOME/.cargo/env
cargo --version
- build: |
source $HOME/.cargo/env
cd stevenarella
cargo build
cargo test

View File

@ -17,9 +17,10 @@ jobs:
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: 1.44.1
components: clippy, rustfmt
default: true
- name: (Linux) Install libxcb-composite
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
@ -29,9 +30,13 @@ jobs:
cargo build --verbose --release
env:
MACOSX_DEPLOYMENT_TARGET: 10.14
- name: (Linux/MacOS) Strip binary
if: matrix.os != 'windows-latest'
run: strip target/release/stevenarella
- name: Run clippy
uses: actions-rs/clippy-check@v1.0.7
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets -- -D warnings
- name: Check formatting
run: cargo fmt --all -- --check
- name: Move binary
run: |
if [[ ${{ matrix.os }} == windows ]]; then

View File

@ -1,5 +1,5 @@
# Stevenarella
[![builds.sr.ht status](https://builds.sr.ht/~iceiix/stevenarella.svg)](https://builds.sr.ht/~iceiix/stevenarella?)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Ficeiix%2Fstevenarella%2Fbadge%3Fref%3Dmaster&style=plastic)](https://actions-badge.atrox.dev/iceiix/stevenarella/goto?ref=master)
Multi-protocol Minecraft-compatible client written in Rust
@ -56,8 +56,9 @@ Support for older protocols will _not_ be dropped as newer protocols are added.
## Downloads
Windows users can download pre-compiled builds from here: https://ci.appveyor.com/project/iceiix/stevenarella
(Select your platform, Click the artifacts tab and download Steven.zip)
Windows, Ubuntu Linux, and macOS users can download pre-compiled builds
from [GitHub Actions](https://actions-badge.atrox.dev/iceiix/stevenarella/goto?ref=master).
(Click the artifacts drop-down and select your platform.)
## Building

View File

@ -1,51 +0,0 @@
version: 1.0.{build}
image: Visual Studio 2017
clone_depth: 1
skip_branch_with_pr: true
branches:
only:
- master
platform:
- x64
build_script:
- cmd: >-
echo on
echo AddMessage "PLATFORM is %PLATFORM%"
if "%PLATFORM%" == "x86" set RUST_INSTALL=i686-pc-windows-msvc
if "%PLATFORM%" == "x64" set RUST_INSTALL=x86_64-pc-windows-msvc
echo AddMessage "platform is %platform%"
appveyor AddMessage "Platform rust: %RUST_INSTALL%"
appveyor DownloadFile "https://static.rust-lang.org/dist/rust-1.44.1-%RUST_INSTALL%.exe" -FileName rust-install.exe
"./rust-install.exe" /VERYSILENT /NORESTART /DIR="C:\Rust\"
SET PATH=%PATH%;C:\Rust\bin
rustc -V
cargo -V
cargo build
mkdir dist-debug
cp target\debug\stevenarella.exe dist-debug
cargo build --release
mkdir dist
cp target\release\stevenarella.exe dist
artifacts:
- path: dist
- path: dist-debug

View File

@ -1,17 +0,0 @@
jobs:
- template: default.yml@templates
parameters:
setup:
- script: sudo apt-get install libxcb-composite0-dev libx11-dev
displayName: "Install build dependencies"
condition: eq(variables['Agent.OS'], 'Linux')
minrust: 1.44.1
clippy: -D clippy::all
resources:
repositories:
- repository: templates
type: github
name: iceiix/azure-pipelines
ref: c50d2b8335a6b1856aa2fc4f5f41f6684ef8580c
endpoint: iceiix