Skip to content

Continuous Integration #2237

Continuous Integration

Continuous Integration #2237

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches:
- main
schedule:
- cron: "0 5 * * *" # runs every day at 5am UTC
defaults:
run:
shell: bash
concurrency:
group: ${{ github.ref_name }}-ci
cancel-in-progress: true
permissions:
contents: read
jobs:
unit-test:
name: Unit Test
runs-on: ubuntu-22.04
permissions:
contents: read
strategy:
fail-fast: false
matrix:
go-version: [stable]
steps:
- name: Checkout Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Golang Environment
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: ${{ matrix.go-version }}
- name: Run Unit Tests
run: make unit-test
build:
name: Build Client
runs-on: ubuntu-22.04
permissions:
contents: write
if: ${{ github.event.repository.fork == false }}
steps:
- name: Checkout Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Switch Repository (Nightly)
if: (github.event_name == 'schedule')
run: |
sed -i 's|pkgs.nginx.com|pkgs-test.nginx.com|g' docker/Dockerfile
sed -i '16d' docker/Dockerfile
sed -i "17i sed -i 's|pkgs|pkgs-test|g' /etc/apt/apt.conf.d/90pkgs-nginx" docker/Dockerfile
sed -i 's|deb https|deb [trusted=yes] https|g' docker/Dockerfile
sed -i 's|\${NGINX_PLUS_VERSION}/||g' docker/Dockerfile
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Build Plus Docker Image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
file: docker/Dockerfile
tags: nginx-plus
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
secrets: |
"nginx-repo.crt=${{ secrets.NGINX_CRT }}"
"nginx-repo.key=${{ secrets.NGINX_KEY }}"
- name: Test Client
run: docker compose up test --exit-code-from test
- name: Test Client No Stream
run: docker compose up test-no-stream --exit-code-from test-no-stream
- name: Create/Update Draft
uses: lucacome/draft-release@e076259ceb036bc5f2c2a76559784c12cf8d2e74 # v1.0.4
id: release-notes
with:
minor-label: "enhancement"
major-label: "change"
publish: ${{ github.ref_type == 'tag' }}
collapse-after: 50
if: ${{ github.event_name == 'push' }}
- name: Setup Golang Environment
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: stable
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
if: ${{ github.ref_type == 'tag' }}