-
-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (141 loc) · 4.83 KB
/
tip.yml
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
name: Continuous master build
on:
push:
branches:
- master
jobs:
clippy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: target/
key: cargo-clippy-cache-${{ matrix.arch.target }}
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-12-31
override: true
components: clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
test:
strategy:
matrix:
arch:
- { name: "x86_64", os: "ubuntu-20.04", target: "x86_64-unknown-linux-gnu", cross: false }
runs-on: ${{ matrix.arch.os }}
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}
ports:
- 3306:3306
steps:
- name: Install dependencies
run: sudo apt install -y libcap-dev libjq-dev libonig-dev
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: target/
key: cargo-test-cache-${{ matrix.arch.target }}
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-12-31
override: true
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- run: env
- name: Test suite
run: |
mkdir dist/
sudo capsh --caps='cap_net_raw+eip cap_setpcap,cap_setuid,cap_setgid+ep' --keep=1 --user=runner --addamb=cap_net_raw -- -c "PATH=$PATH HOME=/home/runner LD_LIBRARY_PATH=${pythonLocation}/lib JQ_LIB_DIR=/usr/lib/x86_64-linux-gnu DSN=mysql://root:${{ secrets.MYSQL_ROOT_PASSWORD }}@127.0.0.1/information_schema?ssl-mode=DISABLED cargo test --all-features"
build:
strategy:
matrix:
arch:
- { name: "x86_64", os: "ubuntu-20.04", target: "x86_64-unknown-linux-gnu", cross: false }
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.arch.os }}
steps:
- name: Install dependencies
run: sudo apt install -y libcap-dev libjq-dev libonig-dev
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
target/
assets/node_modules/
key: cargo-build-cache-${{ matrix.arch.target }}
- uses: actions/setup-node@v3
with:
node-version: "14.x"
registry-url: <registry url>
- run: |
yarn --cwd assets
yarn --cwd assets build
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-12-31
override: true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features --target=${{ matrix.arch.target }}
use-cross: ${{ matrix.arch.cross }}
env:
JQ_LIB_DIR: /usr/lib/x86_64-linux-gnu
- name: Rename artifact
run: |
mv target/${{ matrix.arch.target }}/release/defcon target/${{ matrix.arch.target }}/release/defcon-tip-${{ matrix.arch.name }}-py${{ matrix.python }}
mv target/${{ matrix.arch.target }}/release/defcon-runner target/${{ matrix.arch.target }}/release/defcon-runner-tip-${{ matrix.arch.name }}-py${{ matrix.python }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: defcon-tip-${{ matrix.arch.name }}-py${{ matrix.python }}
path: |
target/${{ matrix.arch.target }}/release/defcon-tip-${{ matrix.arch.name }}-py${{ matrix.python }}
target/${{ matrix.arch.target }}/release/defcon-runner-tip-${{ matrix.arch.name }}-py${{ matrix.python }}
doc:
runs-on: ubuntu-20.04
needs: [clippy, test, build]
steps:
- uses: actions/checkout@v3
- name: Install mdbook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: "0.4.6"
- name: Build user manual
run: mdbook build docs/
- name: Build API documentation
uses: seeebiii/redoc-cli-github-action@v10
with:
args: bundle -o docs/book/api.html docs/api/openapi.yml
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book/
package:
runs-on: ubuntu-20.04
needs: [clippy, test, build]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: target/out
- name: Create release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: tip
title: Development build
prerelease: true
files: target/out/*/*