2022-07-05 06:14:21 +03:00
|
|
|
name: Unit Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
unit-test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-01-02 09:44:39 +03:00
|
|
|
go-version: [1.21.x]
|
2022-12-22 11:47:43 +03:00
|
|
|
os: [ubuntu-latest]
|
2022-07-05 06:14:21 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Install Go
|
2022-12-22 11:47:43 +03:00
|
|
|
uses: actions/setup-go@v3
|
2022-07-05 06:14:21 +03:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
|
|
|
|
- name: Checkout code
|
2022-12-22 11:47:43 +03:00
|
|
|
uses: actions/checkout@v3
|
2022-07-05 06:14:21 +03:00
|
|
|
|
2022-12-22 11:47:43 +03:00
|
|
|
- uses: actions/cache@v3
|
2022-07-05 06:14:21 +03:00
|
|
|
with:
|
|
|
|
# In order:
|
|
|
|
# * Module download cache
|
|
|
|
# * Build cache (Linux)
|
|
|
|
# * Build cache (Mac)
|
|
|
|
# * Build cache (Windows)
|
|
|
|
path: |
|
|
|
|
~/go/pkg/mod
|
|
|
|
~/.cache/go-build
|
|
|
|
~/Library/Caches/go-build
|
2022-12-22 11:47:43 +03:00
|
|
|
~\AppData\Local\go-build
|
2022-07-05 06:14:21 +03:00
|
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-go-
|
|
|
|
|
2022-10-07 10:13:32 +03:00
|
|
|
- name: Unit Test
|
2022-07-05 06:14:21 +03:00
|
|
|
env:
|
2023-04-18 10:51:26 +03:00
|
|
|
CGO_CFLAGS: "-O -D__BLST_PORTABLE__"
|
|
|
|
CGO_CFLAGS_ALLOW: "-O -D__BLST_PORTABLE__"
|
2022-07-05 06:14:21 +03:00
|
|
|
ANDROID_HOME: "" # Skip android test
|
|
|
|
run: |
|
2023-02-03 12:38:20 +03:00
|
|
|
go mod download
|
2022-07-05 06:14:21 +03:00
|
|
|
make test
|
|
|
|
|