owncast/.github/workflows/go-tests.yaml

90 lines
2 KiB
YAML
Raw Normal View History

name: Go Tests
on:
push:
paths-ignore:
- 'web/**'
pull_request:
paths-ignore:
- 'web/**'
jobs:
test:
2021-08-28 01:24:21 +03:00
strategy:
matrix:
go-version: [1.21.x, 1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
2021-08-28 01:24:21 +03:00
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changed-files-yaml
uses: tj-actions/changed-files@v45
with:
files_yaml: |
src:
- '**/*.{go,mod,sum}'
- uses: actions/cache@v4
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-test-${{ github.sha }}
restore-keys: |
go-test-
- name: Install go
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
uses: actions/setup-go@v5
with:
go-version: '^1'
2023-02-16 02:01:14 +03:00
cache: true
- name: Run tests
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: go test ./...
test-bsds:
2022-07-28 00:17:35 +03:00
runs-on: macos-latest
strategy:
matrix:
os:
- name: freebsd
version: 12.2
- name: openbsd
version: 6.8
steps:
- uses: actions/checkout@v4
2024-07-11 21:53:35 +03:00
- name: Get changed files
id: changed-files-yaml
uses: tj-actions/changed-files@v45
2024-07-11 21:53:35 +03:00
with:
files_yaml: |
src:
- '**/*.{go,mod,sum}'
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-test-${{ github.sha }}
restore-keys: |
go-test-
- name: Install go
2024-07-11 21:53:35 +03:00
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
uses: actions/setup-go@v5
with:
go-version: '^1'
2023-02-16 02:01:14 +03:00
cache: true
- name: Run tests
2024-07-11 21:53:35 +03:00
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: go test ./...