ci: Add BSDs #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
detect-changes: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
# Set job outputs to values from filter step | |
outputs: | |
documentation: ${{ steps.filter.outputs.documentation }} | |
cli: ${{ steps.filter.outputs.cli }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
documentation: | |
- '.github/workflows/**' | |
- 'docs/**' | |
cli: | |
- '.github/workflows/**' | |
- 'bin/**' | |
- 'lib/**' | |
- 'scripts/**' | |
- 'test/**' | |
- '.tool-versions' | |
- 'asdf.*' | |
- 'defaults' | |
- 'help.txt' | |
ubuntu: | |
needs: detect-changes | |
# only run if | |
# - changes to cli | |
if: ${{ needs.detect-changes.outputs.cli == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: scripts/install_dependencies.bash | |
- run: scripts/test.bash | |
env: | |
GITHUB_API_TOKEN: ${{ github.token }} | |
freeebsd: | |
# needs: detect-changes | |
# only run if | |
# - changes to cli | |
# if: ${{ needs.detect-changes.outputs.cli == 'true' }} | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test in FreeBSD | |
uses: vmactions/freebsd-vm@v0 | |
with: | |
usesh: true | |
prepare: | | |
pkg install -y devel/bats-core devel/git net/curl | |
run: | | |
bats ./test | |
openbsd: | |
# needs: detect-changes | |
# only run if | |
# - changes to cli | |
# if: ${{ needs.detect-changes.outputs.cli == 'true' }} | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test in OpenBSD | |
uses: vmactions/openbsd-vm@v0 | |
with: | |
usesh: true | |
prepare: | | |
pkg install -y devel/bats-core devel/git net/curl | |
run: | | |
bats ./test | |
macos: | |
needs: detect-changes | |
# only run if | |
# - changes to cli | |
if: ${{ needs.detect-changes.outputs.cli == 'true' }} | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: scripts/install_dependencies.bash | |
- run: scripts/test.bash | |
env: | |
GITHUB_API_TOKEN: ${{ github.token }} | |
documentation-site: | |
needs: detect-changes | |
# only run if | |
# - changes to documentation | |
# - pull_request (workflows/docs.yml deploys on main branch) | |
if: ${{ github.event_name == 'pull_request' && needs.detect-changes.outputs.documentation == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# fetch all commits to get git log info for Vuepress | |
fetch-depth: 0 | |
# only run steps past here if changes to docs/** directory | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- uses: actions/cache@v3 | |
id: npm-cache | |
with: | |
path: | | |
docs/node_modules | |
key: ${{ runner.os }}-npm-${{ hashFiles('docs/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm- | |
- name: Install dependencies | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
working-directory: docs/ | |
run: npm install | |
- name: Check errors by building Documentation site | |
working-directory: docs/ | |
run: npm run build |