Skip to content

GitHub

GitHub #64

Workflow file for this run

name: GitHub
on:
push:
branches:
- main
- feature/*
pull_request:
branches:
- main
schedule:
- cron: "0 23 * * 5"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
- name: Paths Filter
uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: ${{ github.event.pull_request.base.ref || github.base_ref || github.ref }}
filters: |
shared: &shared
- 'home/.chezmoi*'
- 'home/.chezmoiscripts/universal/**'
- 'home/.chezmoitemplates/universal/**'
- 'home/dot_*/**'
- 'home/private_dot_*/**'
- 'install.sh'
- .github/workflows/github.yaml
ubuntu-22.04:
- *shared
- 'home/.chezmoiscripts/ubuntu/*'
- 'home/.chezmoitemplates/ubuntu/*'
macos-12:
- *shared
- 'home/.chezmoiscripts/darwin/*'
- 'home/.chezmoitemplates/darwin/*'
- name: Set Matrix
id: set-matrix
run: |
MATRIX=$(echo '${{ steps.filter.outputs.changes }}' | jq -c 'del(.[] | select(. == "shared")) | {os: select(length > 0) }')
echo matrix="$MATRIX" >> $GITHUB_OUTPUT
host-build:
needs: [changes]
if: ${{ needs.changes.outputs.matrix != '' && needs.changes.outputs.matrix != '[]' }}
strategy:
matrix: ${{ fromJSON(needs.changes.outputs.matrix) }}
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
- name: Run install
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: ./install.sh
- name: Switch to ZSH
if: runner.os == 'Linux'
shell: /home/linuxbrew/.linuxbrew/bin/zsh {0}
run: |
source ~/.zshenv
~/.local/bin/check-dotfiles
- name: Switch to ZSH
if: runner.os == 'macOS'
shell: /usr/local/bin/zsh {0}
run: |
source ~/.zshenv
~/.local/bin/check-dotfiles