mirror of
https://github.com/dokku/buildpack-nginx.git
synced 2026-04-30 11:37:35 +00:00
Merge pull request #99 from dokku/add-ci-workflow
feat: add CI workflow to lint and compile nginx on PRs
This commit is contained in:
@ -1,13 +1,31 @@
|
|||||||
---
|
---
|
||||||
name: "release"
|
name: "ci"
|
||||||
|
|
||||||
# yamllint disable-line rule:truthy
|
# yamllint disable-line rule:truthy
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- main
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- main
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [created]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-assets:
|
lint:
|
||||||
|
if: github.event_name != 'release'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Run shellcheck
|
||||||
|
run: make test
|
||||||
|
|
||||||
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@ -32,12 +50,19 @@ jobs:
|
|||||||
"${NGINX_CONFIGURE_FLAGS[@]}"
|
"${NGINX_CONFIGURE_FLAGS[@]}"
|
||||||
sed -i "/CFLAGS/s/ \-O //g" objs/Makefile
|
sed -i "/CFLAGS/s/ \-O //g" objs/Makefile
|
||||||
make -j"$(nproc)"
|
make -j"$(nproc)"
|
||||||
cp objs/nginx /tmp/nginx-linux-amd64
|
|
||||||
chmod +x /tmp/nginx-linux-amd64
|
- name: Verify nginx binary
|
||||||
|
run: |
|
||||||
|
source "$GITHUB_WORKSPACE/conf/nginx-configure-flags"
|
||||||
|
/tmp/nginx-${NGINX_VERSION}/objs/nginx -V
|
||||||
|
|
||||||
- name: Upload release assets
|
- name: Upload release assets
|
||||||
|
if: github.event_name == 'release'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
run: |
|
run: |
|
||||||
|
source "$GITHUB_WORKSPACE/conf/nginx-configure-flags"
|
||||||
|
cp /tmp/nginx-${NGINX_VERSION}/objs/nginx /tmp/nginx-linux-amd64
|
||||||
|
chmod +x /tmp/nginx-linux-amd64
|
||||||
gh release upload "${{ github.event.release.tag_name }}" \
|
gh release upload "${{ github.event.release.tag_name }}" \
|
||||||
/tmp/nginx-linux-amd64
|
/tmp/nginx-linux-amd64
|
||||||
Reference in New Issue
Block a user