2024-10-17 00:18:20 +09:00
|
|
|
name: test
|
|
|
|
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
2024-12-06 03:34:13 +09:00
|
|
|
container:
|
|
|
|
image: node:16-bookworm-slim
|
2024-10-17 00:18:20 +09:00
|
|
|
steps:
|
2024-12-06 03:34:13 +09:00
|
|
|
- name: Get dependencies
|
|
|
|
run: >-
|
|
|
|
echo 'deb http://deb.debian.org/debian bookworm-backports main' >> /etc/apt/sources.list.d/backports.list &&
|
|
|
|
apt-get update &&
|
|
|
|
apt-get install -y
|
|
|
|
git
|
|
|
|
gcc
|
|
|
|
pkg-config
|
|
|
|
libwayland-dev
|
|
|
|
wayland-protocols/bookworm-backports
|
|
|
|
libxcb1-dev
|
|
|
|
libacl1-dev
|
|
|
|
if: ${{ runner.os == 'Linux' }}
|
|
|
|
|
2024-10-17 00:18:20 +09:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup go
|
|
|
|
uses: https://github.com/actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: '>=1.23.0'
|
|
|
|
|
2024-12-06 03:34:13 +09:00
|
|
|
- name: Go generate
|
2024-10-17 00:18:20 +09:00
|
|
|
run: >-
|
2024-12-06 03:34:13 +09:00
|
|
|
go generate ./...
|
2024-10-17 00:18:20 +09:00
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: >-
|
|
|
|
go test ./...
|
|
|
|
|
|
|
|
- name: Build for Linux
|
|
|
|
run: >-
|
2024-11-04 13:43:57 +09:00
|
|
|
go build -v -ldflags '-s -w
|
|
|
|
-X git.ophivana.moe/security/fortify/internal.Version=${{ github.ref_name }}
|
|
|
|
-X git.ophivana.moe/security/fortify/internal.Fsu=/usr/bin/fsu
|
|
|
|
-X git.ophivana.moe/security/fortify/internal.Finit=/usr/libexec/fortify/finit
|
2024-11-16 21:19:45 +09:00
|
|
|
-X main.Fmain=/usr/bin/fortify
|
|
|
|
-X main.Fshim=/usr/libexec/fortify/fshim'
|
2024-11-04 13:43:57 +09:00
|
|
|
-o bin/ ./... &&
|
|
|
|
(cd bin && sha512sum --tag -b * > sha512sums)
|