2021-03-02 16:46:50 +02:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- "**/*.go"
|
|
|
|
- "go.mod"
|
|
|
|
- "go.sum"
|
|
|
|
- ".github/workflows/*.yml"
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
paths:
|
|
|
|
- "**/*.go"
|
|
|
|
- "go.mod"
|
|
|
|
- "go.sum"
|
|
|
|
- ".github/workflows/*.yml"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
2022-02-20 05:53:11 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2021-03-02 16:46:50 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
2023-03-24 03:35:15 +02:00
|
|
|
uses: actions/setup-go@v4
|
2021-03-02 16:46:50 +02:00
|
|
|
with:
|
2023-02-02 08:26:07 +02:00
|
|
|
go-version: '1.20'
|
2022-02-21 16:13:35 +02:00
|
|
|
check-latest: true
|
2021-03-02 16:46:50 +02:00
|
|
|
- name: Checkout codebase
|
2022-03-11 17:47:14 +02:00
|
|
|
uses: actions/checkout@v3
|
2023-02-25 04:26:28 +02:00
|
|
|
- name: Restore Cache
|
|
|
|
uses: actions/cache/restore@v3
|
2023-02-24 19:29:45 +02:00
|
|
|
with:
|
2023-02-25 04:26:28 +02:00
|
|
|
path: resources
|
|
|
|
key: xray-geodat-
|
|
|
|
enableCrossOsArchive: true
|
2021-03-02 16:46:50 +02:00
|
|
|
- name: Test
|
|
|
|
run: go test -timeout 1h -v ./...
|