This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
Fix lint #44
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
ubuntu: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: [ '1.21' ] | |
link: | |
- type: dynamic | |
goflags: "" | |
- type: static | |
# On Ubuntu, libxml2 is compiled with GCC and is linked to libicu, which introduces a | |
# stealth dependency on libstdc++ at link-time | |
goflags: "-ldflags '-extldflags -lstdc++' -tags 'osusergo netgo static_build'" | |
name: "Test [ Go ${{ matrix.go }}, ${{ matrix.link.type }} linking ]" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Cache Go modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
~/.cache/bazel | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Install Go stable version | |
if: matrix.go != 'tip' | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
check-latest: true | |
- name: Run Go tests | |
run: go test ${{ matrix.link.goflags }} ./... | |
- name: Test linking capability | |
run: | | |
go build -o linktest ${{ matrix.link.goflags }} ./test/link | |
file linktest | grep '${{ matrix.link.type }}ally linked' | |
archlinux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: [ '1.21' ] | |
container: | |
image: archlinux:latest | |
name: "Test [ Arch Linux + Go ${{ matrix.go }} ]" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Up Arch Linux | |
run: | | |
pacman -Syy --noconfirm | |
pacman -Syu --noconfirm | |
pacman -S --noconfirm base-devel | |
pacman -S --noconfirm libxml2=2.12.6 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Test | |
run: go test ./... |