Skip to content

Commit 84e79c1

Browse files
authored
Switch to GitHub Actions (feather-rs#196)
* Switch to GitHub Actions Alas, Azure Pipelines was a pain... * Fix clippy & tests, remove jemalloc dependency * Remove nightly clippy lint * Change badge in README to point to GitHub Actions * Also cache .cargo directory * Remove trailing slashes in cache paths * Fix permission issues on ~/.cargo * Another fix.
1 parent a04499f commit 84e79c1

10 files changed

Lines changed: 109 additions & 264 deletions

File tree

.azure-pipelines.yml

Lines changed: 0 additions & 205 deletions
This file was deleted.

.codecov.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ develop, master, staging ]
6+
pull_request:
7+
branches: [ develop, master, staging ]
8+
9+
jobs:
10+
build:
11+
name: "Build and Test"
12+
strategy:
13+
matrix:
14+
os: [ ubuntu-18.04, windows-2019, macos-10.15 ]
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
# Necessary for now for the cargo cache:
21+
# https://github.com/actions/cache/issues/133#issuecomment-599102035
22+
- name: Fix ~/.cargo directory permissions
23+
run: rm -r ~/.cargo
24+
if:
25+
26+
- name: Cache target directory
27+
uses: actions/cache@v1
28+
env:
29+
cache-name: build-target-directory
30+
with:
31+
path: target
32+
key: ${{ runner.os }}-build-${{ env.cache-name }} }}-${{ hashFiles('**/Cargo.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-build-${{ env.cache-name }}-
35+
${{ runner.os }}-build-
36+
${{ runner.os }}-
37+
38+
- name: Cache cargo directory
39+
uses: actions/cache@v1
40+
env:
41+
cache-name: cargo-registry-directory
42+
with:
43+
path: ~/.cargo
44+
key: ${{ runner.os }}-build-${{ env.cache-name }} }}-${{ hashFiles('**/Cargo.lock') }}
45+
restore-keys: |
46+
${{ runner.os }}-build-${{ env.cache-name }}-
47+
${{ runner.os }}-build-
48+
${{ runner.os }}-
49+
50+
- name: Build
51+
run: cargo build
52+
53+
- name: Run tests
54+
run: cargo test
55+
56+
- name: Run Clippy
57+
uses: actions-rs/clippy-check@v1.0.5
58+
with:
59+
# GitHub token
60+
token: ${{ secrets.GITHUB_TOKEN }}
61+
args: --all-targets -- -D warnings
62+
63+
- name: Check formatting
64+
run: cargo fmt -- --check
65+
66+
create-release:
67+
name: Publish to GitHub Releases
68+
strategy:
69+
matrix:
70+
os: [ ubuntu-18.04, windows-2019, macos-10.15 ]
71+
include:
72+
- os: ubuntu-18.04
73+
os-name: linux
74+
- os: windows-2019
75+
os-name: windows
76+
- os: macos-10.15
77+
os-name: macOS
78+
runs-on: ${{ matrix.os }}
79+
80+
if: startsWith(github.ref, 'refs/tags/')
81+
needs: ['build']
82+
83+
steps:
84+
- name: Build (release mode)
85+
run: cargo build --release
86+
87+
- name: Get tag name
88+
uses: olegtarasov/get-tag@v2
89+
id: tagName
90+
91+
- name: Compress executable
92+
uses: papeloto/action-zip@v1
93+
with:
94+
files: target/release/feather-server
95+
dest: target/release/feather-${{ steps.tagName.outputs.tag }}-${{ matrix.os-name }}.zip
96+
97+
- name: Publish release
98+
uses: ncipollo/release-action@v1.6.1
99+
with:
100+
# An optional set of paths representing artifacts to upload to the release. This may be a single path or a comma delimited list of paths (or globs)
101+
artifact: target/release/feather-${{ steps.tagName.outputs.tag }}-${{ matrix.os-name }}.zip
102+
# The Github token.
103+
token: ${{ secrets.GITHUB_TOKEN }}
104+

Cargo.lock

Lines changed: 0 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Feather
2-
[![build](https://dev.azure.com/caelunshun/feather/_apis/build/status/caelunshun.feather?branchName=develop)](https://dev.azure.com/caelunshun/feather/_build/latest?definitionId=1&branchName=develop)
3-
[![coverage](https://codecov.io/gh/caelunshun/feather/branch/develop/graph/badge.svg)](https://codecov.io/gh/caelunshun/feather)
2+
[![build](https://github.com/feather-rs/feather/workflows/build/badge.svg)](https://github.com/feather-rs/feather/actions)
43
[![Discord](https://img.shields.io/discord/619316022800809995)](https://discordapp.com/invite/4eYmK69)
54

65
An experimental Minecraft server implementation written in Rust.
@@ -44,7 +43,7 @@ Feather currently only supports 1.13.2 clients and world saves. In the future, a
4443
### Compiling
4544
If you are on another platform, compile the server yourself to try it out:
4645
```bash
47-
git clone https://github.com/caelunshun/feather
46+
git clone https://github.com/feather-rs/feather
4847
cd feather
4948
cargo build --release
5049
```

0 commit comments

Comments
 (0)