Skip to content

upgrade hyperscan_version to 5.4.2 #199

upgrade hyperscan_version to 5.4.2

upgrade hyperscan_version to 5.4.2 #199

Workflow file for this run

name: Continuous integration
on:
push:
branches:
- master
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
defaults:
run:
shell: bash
jobs:
test:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04, macos-12, macos-11]
go: [stable, 1.20.x, 1.19.x, 1.18.x]
name: Go ${{ matrix.go }} tests @ ${{ matrix.os }} for hyperscan
runs-on: ${{ matrix.os }}
steps:
- name: Install Linux dependencies for testing libraries
if: startsWith(matrix.os, 'ubuntu-')
run: |
sudo apt-get update
sudo apt-get install -yq libhyperscan-dev libpcap-dev
- name: Install MacOS dependencies for testing libraries
if: startsWith(matrix.os, 'macos-')
run: |
brew install hyperscan pkg-config libpcap
- uses: actions/checkout@v3
- name: Install Golang ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache: true
- name: Test Hyperscan v4 API
run: |
go test -v -tags hyperscan_v4 ./internal/hs/... ./hyperscan/...
go test -race -v -tags hyperscan_v4 ./internal/hs/... ./hyperscan/...
- name: Test Hyperscan v5 API
run: |
go test -v ./internal/hs/... ./hyperscan/...
go test -race -v ./internal/hs/... ./hyperscan/...
build-and-test:
strategy:
matrix:
include:
- os: macos-latest
go: stable
hyperscan_version: 5.4.1
pcre_version: 8.45
build_flags: -tags hyperscan_v54,chimera
chimera: true
- os: macos-12
go: stable
hyperscan_version: 5.2.1
pcre_version: 8.45
build_flags: -tags hyperscan_v52,chimera
chimera: true
- os: macos-11
go: stable
hyperscan_version: 5.1.1
pcre_version: 8.45
build_flags: -tags chimera
chimera: true
- os: ubuntu-22.04
go: stable
hyperscan_version: 5.4.1
pcre_version: 8.45
build_flags: -tags hyperscan_v54,chimera
chimera: true
coverage: true
- os: ubuntu-20.04
go: stable
hyperscan_version: 5.2.1
pcre_version: 8.45
build_flags: -tags hyperscan_v52,chimera
chimera: true
name: Go ${{ matrix.go }} tests @ ${{ matrix.os }} for hyperscan ${{ matrix.hyperscan_version }}
runs-on: ${{ matrix.os }}
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/dist/lib/pkgconfig
CGO_CFLAGS: -I${{ github.workspace }}/dist/include/hs
CGO_LDFLAGS: -L${{ github.workspace }}/dist/lib
steps:
- uses: actions/checkout@v3
- name: Install Hyperscan ${{ matrix.hyperscan }} with PCRE ${{ matrix.pcre_version }}
uses: flier/install-hyperscan@main
with:
hyperscan_version: ${{ matrix.hyperscan_version }}
pcre_version: ${{ matrix.pcre_version }}
build_static_lib: on
src_dir: ${{ runner.temp }}/hyperscan/
install_prefix: ${{ github.workspace }}/dist/
cache_key: ${{ runner.os }}-build-hyperscan-${{ matrix.hyperscan_version }}-pcre-${{ matrix.pcre_version }}
- name: Install Golang ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
cache: true
- name: Test Hyperscan API
run: |
go test -v ${{ matrix.build_flags }} ./internal/hs/... ./hyperscan/...
go test -race -v ${{ matrix.build_flags }} ./internal/hs/... ./hyperscan/...
- name: Test Chimera API
if: matrix.chimera
run: |
go test -v ${{ matrix.build_flags }} ./internal/ch/... ./chimera/...
go test -race -v ${{ matrix.build_flags }} ./internal/ch/... ./chimera/...
- name: Run and upload coverage to Codecov
if: matrix.coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
go test -v ${{ matrix.build_flags }} -race -coverprofile=coverage.out -covermode=atomic ./...
bash <(curl -s https://codecov.io/bash)
golangci:
name: lint
runs-on: ubuntu-22.04
steps:
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -yq libhyperscan-dev libpcap-dev
- uses: actions/setup-go@v3
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
working-directory: hyperscan