forked from feather-rs/feather
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (78 loc) · 2.52 KB
/
main.yml
File metadata and controls
94 lines (78 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: build
on:
push:
branches: [ develop, master, staging ]
pull_request:
branches: [ develop, master, staging ]
jobs:
build:
name: "Build and Test"
strategy:
matrix:
os: [ ubuntu-18.04, windows-2019, macos-10.15 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
# Caching
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Install rustfmt
run: rustup component add rustfmt
- name: Run tests
run: cargo test
env:
RUSTFLAGS: "-C opt-level=0"
- name: Install Clippy
run: rustup component add clippy
- name: Run Clippy
run: cargo clippy --all-targets -- -D warnings
env:
RUSTFLAGS: "-C opt-level=0"
- name: Check formatting
run: cargo fmt -- --check
create-release:
name: Publish to GitHub Releases
strategy:
matrix:
os: [ ubuntu-18.04, windows-2019, macos-10.15 ]
include:
- os: ubuntu-18.04
os-name: linux
- os: windows-2019
os-name: windows
- os: macos-10.15
os-name: macOS
runs-on: ${{ matrix.os }}
if: startsWith(github.ref, 'refs/tags/')
needs: ['build']
steps:
- name: Build (release mode)
run: cargo build --release
- name: Get tag name
uses: olegtarasov/get-tag@v2
id: tagName
- name: Compress executable
uses: papeloto/action-zip@v1
with:
files: target/release/feather-server
dest: target/release/feather-${{ steps.tagName.outputs.tag }}-${{ matrix.os-name }}.zip
- name: Publish release
uses: ncipollo/release-action@v1.6.1
with:
# 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)
artifact: target/release/feather-${{ steps.tagName.outputs.tag }}-${{ matrix.os-name }}.zip
# The Github token.
token: ${{ secrets.GITHUB_TOKEN }}