-
Notifications
You must be signed in to change notification settings - Fork 8
101 lines (101 loc) · 2.7 KB
/
test.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
name: Test
on:
pull_request:
jobs:
releases:
name: Releases page
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Run tests
working-directory: releases-generator
run: |
set -euo pipefail
go test -json -v ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
- name: Upload test log
uses: actions/upload-artifact@v2
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt-get install -y shellcheck
- name: Run shellcheck
working-directory: static
run: shellcheck -o all install-opentofu.sh
linux:
name: Linux
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: true
matrix:
distro: [alpine, debian, fedora, opensuse, rocky, ubuntu]
method: [brew, repo, standalone]
shell: [ash, bash, dash, ksh, zsh]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Cosign
uses: sigstore/[email protected]
- name: Test
env:
DISTRO: ${{ matrix.distro }}
METHOD: ${{ matrix.method }}
SH: ${{ matrix.shell }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: tests/linux
run: ./test.sh
macos:
name: MacOS
runs-on: macos-latest
strategy:
fail-fast: true
matrix:
method: [brew, standalone]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Cosign
uses: sigstore/[email protected]
- name: Test
working-directory: tests/macos
run: ./${{ matrix.method }}.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
widows:
name: Windows
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
method: [standalone]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Cosign
uses: sigstore/[email protected]
- name: Test
working-directory: tests\windows
run: .\test.ps1 -method "${{ matrix.method }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}