mirror of
https://github.com/dokku/buildpack-nginx.git
synced 2026-04-24 09:37:36 +00:00
feat: add CI workflow to lint and compile nginx on PRs
This commit is contained in:
53
.github/workflows/ci.yml
vendored
Normal file
53
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
---
|
||||
name: "ci"
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Run shellcheck
|
||||
run: make test
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Download source tarballs
|
||||
run: |
|
||||
source "$GITHUB_WORKSPACE/conf/nginx-configure-flags"
|
||||
cd /tmp
|
||||
curl -sSL "https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" | tar xz
|
||||
curl -sSL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-${PCRE_VERSION}/pcre2-${PCRE_VERSION}.tar.gz" | tar xz
|
||||
curl -sSL "https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz" | tar xz
|
||||
|
||||
- name: Compile nginx
|
||||
run: |
|
||||
source "$GITHUB_WORKSPACE/conf/nginx-configure-flags"
|
||||
cd /tmp/nginx-${NGINX_VERSION}
|
||||
./configure \
|
||||
--prefix=/tmp/nginx-build \
|
||||
--with-pcre=../pcre2-${PCRE_VERSION} \
|
||||
--with-zlib=../zlib-${ZLIB_VERSION} \
|
||||
"${NGINX_CONFIGURE_FLAGS[@]}"
|
||||
sed -i "/CFLAGS/s/ \-O //g" objs/Makefile
|
||||
make -j"$(nproc)"
|
||||
|
||||
- name: Verify nginx binary
|
||||
run: |
|
||||
/tmp/nginx-build/nginx -V
|
||||
Reference in New Issue
Block a user