chore: Add GitHub Action version numbers #1840
This file contains hidden or 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: installer | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| push: | |
| branches: | |
| - master | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| SHA: ${{ github.event_name == 'push' && github.sha || github.event.pull_request.head.sha }} | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| sh: ${{ steps.filter.outputs.sh }} | |
| ps1: ${{ steps.filter.outputs.ps1 }} | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - id: filter | |
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
| with: | |
| filters: | | |
| shared: &shared | |
| - '.github/workflows/installer.yml' | |
| sh: | |
| - *shared | |
| - 'assets/scripts/install*.sh' | |
| - 'internal/cmds/generate-install.sh/install.sh.tmpl' | |
| ps1: | |
| - *shared | |
| - 'assets/scripts/install.ps1' | |
| misspell: | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - uses: reviewdog/action-misspell@d6429416b12b09b4e2768307d53bef58d172e962 # v1.27.0 | |
| with: | |
| locale: US | |
| test-install-sh: | |
| if: ${{ needs.changes.outputs.sh == 'true' }} | |
| strategy: | |
| matrix: | |
| os: | |
| - macos-14 | |
| - ubuntu-22.04 | |
| - windows-2022 | |
| needs: changes | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| BINARY: ${{ matrix.os == 'windows-2022' && 'bin/chezmoi.exe' || 'bin/chezmoi' }} | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - name: test-${{ matrix.os }}-local | |
| shell: bash | |
| run: | | |
| rm -f ${{ env.BINARY }} | |
| sh assets/scripts/install.sh -d | |
| ${{ env.BINARY }} --version | |
| - name: test-${{ matrix.os }}-url | |
| shell: bash | |
| run: | | |
| rm -f ${{ env.BINARY }} | |
| sh -c "$(curl -fsLS https://raw.githubusercontent.com/twpayne/chezmoi/${{ env.SHA }}/assets/scripts/install.sh)" -- -d | |
| ${{ env.BINARY }} --version | |
| test-install-ps1: | |
| if: ${{ needs.changes.outputs.ps1 == 'true' }} | |
| strategy: | |
| matrix: | |
| os: | |
| - macos-14 | |
| - ubuntu-22.04 | |
| - windows-2022 | |
| needs: changes | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| BINARY: ${{ matrix.os == 'windows-2022' && 'bin/chezmoi.exe' || 'bin/chezmoi' }} | |
| steps: | |
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - name: test-${{ matrix.os }}-local-pwsh | |
| shell: pwsh | |
| run: | | |
| if (Test-Path -Path ${{ env.BINARY }}) { Remove-Item -Force ${{ env.BINARY }} } | |
| assets/scripts/install.ps1 -d | |
| ${{ env.BINARY }} --version | |
| - name: test-${{ matrix.os }}-local-powershell | |
| if: matrix.os == 'windows-2022' | |
| shell: powershell | |
| run: | | |
| if (Test-Path -Path ${{ env.BINARY }}) { Remove-Item -Force ${{ env.BINARY }} } | |
| assets/scripts/install.ps1 -d | |
| ${{ env.BINARY }} --version | |
| - name: test-${{ matrix.os }}-url-pwsh | |
| shell: pwsh | |
| run: | | |
| if (Test-Path -Path ${{ env.BINARY }}) { Remove-Item -Force ${{ env.BINARY }} } | |
| iex "&{$(irm 'https://raw.githubusercontent.com/twpayne/chezmoi/${{ env.SHA }}/assets/scripts/install.ps1')} -d" | |
| ${{ env.BINARY }} --version | |
| - name: test-${{ matrix.os }}-url-powershell | |
| if: matrix.os == 'windows-2022' | |
| shell: powershell | |
| run: | | |
| if (Test-Path -Path ${{ env.BINARY }}) { Remove-Item -Force ${{ env.BINARY }} } | |
| iex "&{$(irm 'https://raw.githubusercontent.com/twpayne/chezmoi/${{ env.SHA }}/assets/scripts/install.ps1')} -d" | |
| ${{ env.BINARY }} --version |