Skip to content

feat: New/init command #242

feat: New/init command

feat: New/init command #242

Workflow file for this run

name: Run Tests
on:
push:
branches:
- main
- v*
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
changed-files:
name: Changed Files
runs-on: ubuntu-latest
outputs:
test-source: ${{ steps.changed-files.outputs.test-source_any_modified == 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 50 # Assume PRs are less than 50 commits
- name: Find changed files
uses: tj-actions/changed-files@v44
id: changed-files
with:
files_yaml: |
common: &common
- .github/workflows/test-worker.yml
- Makefile
test-source:
- *common
- cmd/**
- go.*
- '*.go'
source:
name: "Test on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}-latest"
needs: changed-files
if: ${{ needs.changed-files.outputs.test-source == 'true' }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu
- windows
- macos
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23.0
- name: Test
run: |
set -xe
make test
check:
if: always()
name: Tests Successful
runs-on: ubuntu-latest
needs: [source]
steps:
- name: Whether the whole test suite passed
uses: re-actors/[email protected]
with:
allowed-skips: ${{ toJSON(needs) }}
jobs: ${{ toJSON(needs) }}