Skip to content

Bump the gha group with 2 updates #426

Bump the gha group with 2 updates

Bump the gha group with 2 updates #426

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "*"
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
mode:
- cgo
- tinygo
- wazero
os:
- macos-13
- macos-14
- ubuntu-22.04
- windows-2022
exclude:
# https://github.com/tinygo-org/tinygo/issues/3594
- os: windows-2022
mode: tinygo
# No available binary
- os: macos-14
mode: tinygo
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
# TODO: Split lint step to allow it to have a higher minimum Go requirement.
go-version: '^1.22'
cache-dependency-path: |
**/go.sum
magefiles/versions.go
- name: setup re2 for cgo (linux)
if: ${{ startsWith(matrix.os, 'ubuntu-') && matrix.mode == 'cgo' }}
run: sudo apt-get update && sudo apt-get install -y libre2-dev
- name: setup re2 for cgo (mac)
if: ${{ startsWith(matrix.os, 'macos-') && matrix.mode == 'cgo' }}
run: brew install re2
- name: setup msys2 for cgo (windows)
if: ${{ startsWith(matrix.os, 'windows-') && matrix.mode == 'cgo' }}
uses: msys2/setup-msys2@ddf331adaebd714795f1042345e6ca57bd66cea8 # v2
with:
update: true
# This version of go is not sync with setup-go, but this is probably the best we can do
pacboy: gcc:p re2:p go:p pkg-config:p diffutils:p
- name: setup tinygo
if: ${{ matrix.mode == 'tinygo' }}
uses: acifani/setup-tinygo@b2ba42b249c7d3efdfe94166ec0f48b3191404f7 # v1
with:
tinygo-version: 0.33.0
- name: setup wasmtime for tinygo
if: ${{ matrix.mode == 'tinygo' }}
run: go install github.com/wasilibs/tools/cmd/wasmtime@875fe73f677c58d467ee373a9e00e6cb66b268f3
- name: run checks
run: go run mage check
if: ${{ !startsWith(matrix.os, 'windows-') || matrix.mode != 'cgo' }}
env:
RE2_TEST_MODE: ${{ matrix.mode }}
# General coverage should be good enough to not need to slow down development
# on these slow tests.
RE2_TEST_EXHAUSTIVE: ${{ github.event_name != 'pull_request' && '1' || '0'}}
# Windows runner seems to not have enough CPU performance to keep up without a memory limit
GOMEMLIMIT: ${{ github.event_name != 'pull_request' && '1GiB' || '' }}
# Race detector currently fails with Windows
TEST_NORACE: ${{ startsWith(matrix.os, 'windows-') && matrix.mode == 'wazero' && 'true' || '' }}
- name: run checks (windows cgo)
run: go run mage check
if: ${{ startsWith(matrix.os, 'windows-') && matrix.mode == 'cgo' }}
# Shell does not support conditional expressions using matrix, so for now we duplicate the steps
shell: 'msys2 {0}'
env:
RE2_TEST_MODE: ${{ matrix.mode }}
# General coverage should be good enough to not need to slow down development
# on these slow tests.
RE2_TEST_EXHAUSTIVE: ${{ github.event_name != 'pull_request' && '1' || '0'}}
# Windows runner seems to not have enough CPU performance to keep up without a memory limit
GOMEMLIMIT: ${{ github.event_name != 'pull_request' && '1GiB' || '' }}
test-bsd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5
with:
go-version-file: go.work
cache-dependency-path: |
**/go.sum
magefiles/versions.go
- name: Build
run: go test -c .
env:
GOOS: freebsd
- name: Test
uses: cross-platform-actions/action@cdc9ee69ef84a5f2e59c9058335d9c57bcb4ac86 # v0.25.0
with:
operating_system: freebsd
version: '14.0'
shell: bash
run: ./go-re2.test -test.v -test.short
sync_files: runner-to-vm
# Runs tests using wazero inside a minimal golang docker image. This makes sure the code builds
# even when there is no C toolchain available. It is possible for code to work fine with CGO_ENABLED=0
# but not build without a C toolchain available, e.g. if C source files are checked into the repo
# without a build tag to exclude them from pure-Go builds.
docker-build:
runs-on: ubuntu-22.04
container:
image: golang:alpine
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- run: if command -v gcc &> /dev/null; then echo "GCC found but not expected"; exit 321; fi
- run: go run mage test
env:
TEST_NORACE: "true"