-
Notifications
You must be signed in to change notification settings - Fork 0
172 lines (165 loc) · 5.73 KB
/
Copy pathbuild.yml
File metadata and controls
172 lines (165 loc) · 5.73 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: ci
on:
pull_request: {}
push:
branches:
- main
#release:
# types: [published]
workflow_dispatch:
jobs:
# fmt:
# name: Format
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# override: true
# components: rustfmt
# - uses: actions-rs/cargo@v1
# with:
# command: fmt
# args: --all -- --check
# clippy:
# name: Clippy
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# override: true
# components: clippy
# - uses: actions-rs/clippy-check@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# args: --all-targets --all-features -- -D warnings
test:
name: Unitest (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: clippy
- uses: actions-rs/cargo@v1
env:
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
with:
command: test
args: --all --all-features
- name: "Ensure Cargo.lock is not modified"
run: git diff --exit-code Cargo.lock
build-release-linux:
name: Build release Executable (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# - os: ubuntu-latest
# target: aarch64-unknown-linux-musl
env:
BINARY_EXTENSION: _Linux.x86_64
PATH_BINARY: ${{ github.workspace }}/target/${{ matrix.TARGET }}/release/L4AddonEnforcer${{ matrix.EXTENSION }}${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }}
# OPENSSL_STATIC: 1
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v4
- name: Set up Clang
uses: egor-tensin/setup-clang@v1
with:
version: latest
platform: x64
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: clippy
target: ${{ matrix.target }}
- if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt update -y && sudo apt install -y libcairo-dev libpango1.0-dev libwayland-dev libx11-dev && sudo apt install -y "https://launchpad.net/ubuntu/+archive/primary/+files/libfltk1.4-dev_1.4.3-1ubuntu2_amd64.deb"
# ibfltk1.4-dev -y
- uses: actions-rs/cargo@v1
with:
use-cross: false
command: build
args: --profile release --bin L4AddonEnforcer --locked --target=${{ matrix.TARGET }}
- uses: actions/upload-artifact@v4
with:
name: L4AddonEnforcer${{ env.BINARY_EXTENSION }}
path: ${{ env.PATH_BINARY }}
- name: Evaluate shasum
run: echo -n $(shasum -ba 256 ${{ env.PATH_BINARY }} | cut -d " " -f 1) > ${{ env.PATH_BINARY }}.sha256
- uses: actions/upload-artifact@v4
with:
name: L4AddonEnforcer{{ env.BINARY_EXTENSION }}.sha256
path: ${{ env.PATH_BINARY }}.sha256
build-release-windows:
name: Build release Executable (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
env:
BINARY_EXTENSION: ${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }}
PATH_BINARY: ${{ github.workspace }}/target/${{ matrix.TARGET }}/release/L4AddonEnforcer${{ matrix.EXTENSION }}${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }}
OPENSSL_STATIC: 1
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: clippy
target: ${{ matrix.target }}
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --profile release --bin L4AddonEnforcer --locked --target=${{ matrix.TARGET }}
- uses: actions/upload-artifact@v4
with:
name: L4AddonEnforcer_Win64${{ env.BINARY_EXTENSION }}
path: ${{ env.PATH_BINARY }}
- name: Evaluate shasum
run: echo -n $(shasum -ba 256 ${{ env.PATH_BINARY }} | cut -d " " -f 1) > ${{ env.PATH_BINARY }}.sha256
- uses: actions/upload-artifact@v4
with:
name: L4AddonEnforcer_Win64.sha256
path: ${{ env.PATH_BINARY }}.sha256
# - name: '[Optional] Publish Artifact'
# if: ${{ github.event_name == 'release' }}
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ${{ env.PATH_BINARY }}
# asset_name: ${{ matrix.target }}-L4AddonEnforcer${{ env.BINARY_EXTENSION }}
# tag: ${{ github.ref }}
# overwrite: true
# - name: '[Optional] Publish Artifact (shasum)'
# if: ${{ github.event_name == 'release' }}
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ${{ env.PATH_BINARY }}.sha256
# asset_name: ${{ matrix.target }}-L4AddonEnforcer${{ env.BINARY_EXTENSION }}.sha256
# tag: ${{ github.ref }}
# overwrite: true