-
Notifications
You must be signed in to change notification settings - Fork 493
112 lines (112 loc) · 3.72 KB
/
installer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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@11bd71901bbe5b1630ceea73d27597364c9af683
- id: filter
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
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@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: reviewdog/action-misspell@18ffb61effb93b47e332f185216be7e49592e7e1
with:
locale: US
ignore: ackward
test-install-sh:
if: ${{ needs.changes.outputs.sh == 'true' }}
strategy:
matrix:
os:
- macos-13
- ubuntu-20.04
#- windows-2022 # fails with "debug http_download_curl received HTTP status 000"
needs: changes
runs-on: ${{ matrix.os }}
env:
BINARY: ${{ matrix.os == 'windows-2022' && 'bin/chezmoi.exe' || 'bin/chezmoi' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- 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-13
- ubuntu-20.04
- windows-2022
needs: changes
runs-on: ${{ matrix.os }}
env:
BINARY: ${{ matrix.os == 'windows-2022' && 'bin/chezmoi.exe' || 'bin/chezmoi' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- 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