Skip to content

Commit dd67382

Browse files
authored
Add actions (#4)
1 parent 53eeb9b commit dd67382

1 file changed

Lines changed: 106 additions & 0 deletions

File tree

.github/workflows/rust.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
clippy:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Cache
20+
uses: actions/cache@v2.1.5
21+
with:
22+
path: |
23+
~/.cargo/bin/
24+
~/.cargo/registry/index/
25+
~/.cargo/registry/cache/
26+
~/.cargo/git/db/
27+
target/
28+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
29+
30+
- uses: actions-rs/toolchain@v1
31+
with:
32+
toolchain: nightly
33+
34+
- name: Run clippy
35+
env:
36+
TERM: "xterm"
37+
run: |
38+
rustup component add clippy --toolchain nightly-x86_64-unknown-linux-gnu
39+
make clippy
40+
41+
42+
GNU_Linux_build:
43+
needs: clippy
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
49+
- name: Cache
50+
uses: actions/cache@v2.1.5
51+
with:
52+
path: |
53+
~/.cargo/bin/
54+
~/.cargo/registry/index/
55+
~/.cargo/registry/cache/
56+
~/.cargo/git/db/
57+
target/
58+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
59+
60+
- uses: actions-rs/toolchain@v1
61+
with:
62+
toolchain: nightly
63+
64+
- name: Release build
65+
run: make release
66+
67+
- name: Upload a Build Artifact
68+
uses: actions/upload-artifact@v2.2.3
69+
with:
70+
# Artifact name
71+
name: luxya_GNU_Linux
72+
# A file, directory or wildcard pattern that describes what to upload
73+
path: target/release/luxya
74+
75+
Windows_build:
76+
needs: clippy
77+
runs-on: windows-latest
78+
79+
steps:
80+
- uses: actions/checkout@v2
81+
82+
- name: Cache
83+
uses: actions/cache@v2.1.5
84+
with:
85+
path: |
86+
~/.cargo/bin/
87+
~/.cargo/registry/index/
88+
~/.cargo/registry/cache/
89+
~/.cargo/git/db/
90+
target/
91+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
92+
93+
- uses: actions-rs/toolchain@v1
94+
with:
95+
toolchain: nightly
96+
97+
- name: Release build
98+
run: make release
99+
100+
- name: Upload a Build Artifact
101+
uses: actions/upload-artifact@v2.2.3
102+
with:
103+
# Artifact name
104+
name: luxya_Windows
105+
# A file, directory or wildcard pattern that describes what to upload
106+
path: target/release/luxya.exe

0 commit comments

Comments
 (0)