Skip to content

Commit dbea8fb

Browse files
authored
Merge pull request #9 from alithethird/ci-cross-platform-setup
Add actions
2 parents d80278a + 08ee68b commit dbea8fb

13 files changed

Lines changed: 302 additions & 210 deletions

.github/workflows/pr-test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: PR Rust CI
2+
3+
on:
4+
pull_request:
5+
branches: ["master"]
6+
7+
jobs:
8+
rust-ci:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Install Rust toolchain
15+
uses: actions-rs/toolchain@v1
16+
with:
17+
toolchain: stable
18+
profile: minimal
19+
components: clippy
20+
21+
- name: Build (release)
22+
run: cargo build --release
23+
24+
- name: Run unit/integration tests
25+
run: cargo test --all --release
26+
27+
- name: Run clippy
28+
run: cargo clippy --all -- -D warnings

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Cross-Platform Release
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
7+
jobs:
8+
build-release:
9+
name: Build & Upload Binaries
10+
strategy:
11+
matrix:
12+
include:
13+
- os: ubuntu-latest
14+
target: x86_64-unknown-linux-gnu
15+
ext: ""
16+
- os: ubuntu-latest
17+
target: aarch64-unknown-linux-gnu
18+
ext: ""
19+
- os: macos-latest
20+
target: x86_64-apple-darwin
21+
ext: ""
22+
- os: macos-latest
23+
target: aarch64-apple-darwin
24+
ext: ""
25+
- os: windows-latest
26+
target: x86_64-pc-windows-msvc
27+
ext: ".exe"
28+
- os: windows-latest
29+
target: aarch64-pc-windows-msvc
30+
ext: ".exe"
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
36+
- name: Install Rust toolchain
37+
uses: actions-rs/toolchain@v1
38+
with:
39+
toolchain: stable
40+
profile: minimal
41+
target: ${{ matrix.target }}
42+
43+
- name: Build release binary
44+
run: cargo build --release --target ${{ matrix.target }}
45+
46+
- name: Rename binary
47+
run: |
48+
mv target/${{ matrix.target }}/release/vipyrdocs${{ matrix.ext }} vipyrdocs-${{ matrix.target }}${{ matrix.ext }}
49+
50+
- name: Upload binary
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: vipyrdocs-${{ matrix.target }}${{ matrix.ext }}
54+
path: vipyrdocs-${{ matrix.target }}${{ matrix.ext }}
55+
56+
package-source:
57+
name: Package & Upload Source
58+
runs-on: ubuntu-latest
59+
needs: build-release
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v4
63+
- name: Package source code
64+
run: tar czvf vipyrdocs-source.tar.gz .
65+
- name: Upload source tarball
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: vipyrdocs-source.tar.gz
69+
path: vipyrdocs-source.tar.gz

0 commit comments

Comments
 (0)