Xray-core/.github/workflows/test.yml

74 lines
1.6 KiB
YAML
Raw Normal View History

name: Test
on:
2024-12-12 04:02:24 +00:00
workflow_dispatch:
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:
permissions:
contents: read
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
2024-08-26 02:30:38 +00:00
go-version: '1.23'
2022-02-21 14:13:35 +00:00
check-latest: true
2023-02-25 02:26:28 +00:00
- name: Restore Cache
uses: actions/cache/restore@v4
with:
2023-02-25 02:26:28 +00:00
path: resources
key: xray-geodat-
enableCrossOsArchive: true
- name: Test
run: go test -timeout 1h -v ./...
2024-12-12 04:02:24 +00:00
freebsd:
permissions:
contents: read
name: test (freebsd)
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Restore Cache
uses: actions/cache/restore@v4
with:
path: resources
key: xray-geodat-
enableCrossOsArchive: true
- name: Start VM
id: vm
uses: vmactions/freebsd-vm@v1
with:
prepare: |
pkg install -y go123
pw user add -n action -m
- name: Test
shell: freebsd {0}
run: |
cd $GITHUB_WORKSPACE
go123 version
su action -c 'go123 test -timeout 1h -v ./...'