Skip to content

Commit 8ad48be

Browse files
committed
CI: added basic set of workflows.
1 parent d75ffe0 commit 8ad48be

File tree

3 files changed

+155
-0
lines changed

3 files changed

+155
-0
lines changed

.github/workflows/cargo-deny.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: cargo-deny
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
checks:
14+
- advisories
15+
- bans licenses sources
16+
17+
# Prevent sudden announcement of a new advisory from failing ci:
18+
continue-on-error: ${{ matrix.checks == 'advisories' }}
19+
20+
steps:
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
- uses: EmbarkStudios/cargo-deny-action@34899fc7ba81ca6268d5947a7a16b4649013fea1 # v2.0.11
23+
with:
24+
command: check ${{ matrix.checks }}

.github/workflows/nginx.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: NGINX
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
env:
10+
CARGO_TERM_COLOR: 'always'
11+
RUST_BACKTRACE: '1'
12+
NGX_CONFIGURE_CMD: >-
13+
auto/configure
14+
--with-compat
15+
--with-debug
16+
--with-http_realip_module
17+
--with-http_ssl_module
18+
--with-http_v2_module
19+
--with-stream
20+
--with-stream_realip_module
21+
--with-stream_ssl_module
22+
23+
NGX_CONFIGURE_UNIX: >-
24+
--with-http_v3_module
25+
--with-threads
26+
27+
NGX_CONFIGURE_DYNAMIC_MODULES: >-
28+
--add-dynamic-module=${{ github.workspace }}
29+
NGX_CONFIGURE_STATIC_MODULES: >-
30+
--add-module=${{ github.workspace }}
31+
32+
NGX_TEST_FILES: t
33+
NGX_TEST_GLOBALS_DYNAMIC: >-
34+
load_module ${{ github.workspace }}/nginx/objs/ngx_http_acme_module.so;
35+
36+
jobs:
37+
linux:
38+
runs-on: ubuntu-latest
39+
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
nginx-ref:
44+
- master
45+
- stable-1.28
46+
module:
47+
- static
48+
- dynamic
49+
50+
steps:
51+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
53+
with:
54+
ref: ${{ matrix.nginx-ref }}
55+
repository: 'nginx/nginx'
56+
path: 'nginx'
57+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
with:
59+
repository: 'nginx/nginx-tests'
60+
path: 'nginx/tests'
61+
sparse-checkout: |
62+
lib
63+
64+
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
65+
with:
66+
toolchain: stable
67+
68+
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
69+
with:
70+
path: |
71+
~/.cargo/bin/
72+
~/.cargo/registry/index/
73+
~/.cargo/registry/cache/
74+
~/.cargo/git/db/
75+
nginx/objs/**/CACHEDIR.TAG
76+
nginx/objs/**/ngx-debug
77+
nginx/objs/**/ngx-release
78+
key: ${{ runner.os }}-nginx-${{ hashFiles('**/Cargo.lock') }}
79+
restore-keys: ${{ runner.os }}-nginx-
80+
81+
- name: Configure nginx with static modules
82+
if: matrix.module == 'static'
83+
working-directory: nginx
84+
run: |
85+
${NGX_CONFIGURE_CMD} \
86+
${NGX_CONFIGURE_UNIX} \
87+
${NGX_CONFIGURE_STATIC_MODULES}
88+
89+
- name: Configure nginx with dynamic modules
90+
if: matrix.module != 'static'
91+
working-directory: nginx
92+
run: |
93+
${NGX_CONFIGURE_CMD} \
94+
${NGX_CONFIGURE_UNIX} \
95+
${NGX_CONFIGURE_DYNAMIC_MODULES}
96+
echo TEST_NGINX_GLOBALS="$NGX_TEST_GLOBALS_DYNAMIC" >> "$GITHUB_ENV"
97+
98+
- name: Build nginx
99+
working-directory: nginx
100+
run: make -j$(nproc)
101+
102+
- name: Run tests
103+
env:
104+
PERL5LIB: ${{ github.workspace }}/nginx/tests/lib
105+
TEST_NGINX_BINARY: ${{ github.workspace }}/nginx/objs/nginx
106+
TEST_NGINX_MODULES: ${{ github.workspace }}/nginx/objs
107+
TEST_NGINX_VERBOSE: 1
108+
run: |
109+
prove -j$(nproc) --state=save ${NGX_TEST_FILES} || prove -v --state=failed

deny.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[bans]
2+
multiple-versions = "warn"
3+
4+
[graph]
5+
all-features = true
6+
7+
[licenses]
8+
allow = [
9+
"Apache-2.0",
10+
"BSD-3-Clause",
11+
"ISC",
12+
"MIT",
13+
"Unicode-3.0",
14+
]
15+
confidence-threshold = 0.8
16+
17+
[[licenses.clarify]]
18+
crate = "ring"
19+
expression = "MIT AND ISC AND OpenSSL"
20+
license-files = [
21+
{ path = "LICENSE", hash = 0xbd0eed23 }
22+
]

0 commit comments

Comments
 (0)