-
-
Notifications
You must be signed in to change notification settings - Fork 67
105 lines (89 loc) · 2.99 KB
/
tests.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
name: CI
on:
push:
branches: master
pull_request:
jobs:
rspec:
strategy:
matrix:
include:
- os: macOS
runner: macOS-latest
- os: Linux
runner: ubuntu-latest
name: RSpec (${{ matrix.os }})
runs-on: ${{ matrix.runner }}
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Set up Ruby
uses: ruby/setup-ruby@7bae1d00b5db9166f4f0fc47985a3a5702cb58f0 # v1.197.0
with:
bundler-cache: true
- name: Run Homebrew/homebrew-test-bot RSpec tests
run: bundle exec rspec
tests:
permissions:
contents: read
strategy:
matrix:
include:
- os: macOS
runner: macOS-latest
- os: Linux
runner: ubuntu-latest
workdir: /github/home
container:
image: ghcr.io/homebrew/ubuntu22.04:master
options: --user=linuxbrew
name: ${{ matrix.os }}
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container }}
defaults:
run:
shell: bash
working-directory: ${{ matrix.workdir || github.workspace }}
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@734d9cb93d6f7610c2400b0f789eaa6f9813e271 # v3
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-
- run: brew test-bot --only-cleanup-before
- run: brew test-bot --only-setup
- run: brew test-bot --only-tap-syntax
- run: brew test-bot --only-formulae-detect --test-default-formula
id: formulae-detect
- id: brew-test-bot-formulae
run: |
brew test-bot \
--only-formulae \
--junit \
--only-json-tab \
--skip-dependents \
--testing-formulae=${{ steps.formulae-detect.outputs.testing_formulae }}
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
brew test-bot --only-formulae-dependents --junit \
--testing-formulae=${{ steps.formulae-detect.outputs.testing_formulae }} \
--skipped-or-failed-formulae=${{ steps.brew-test-bot-formulae.outputs.skipped_or_failed_formulae }}
- name: Output brew test-bot failures
run: |
cat steps_output.txt
rm steps_output.txt
- name: Output brew bottle output
run: |
cat bottle_output.txt
rm bottle_output.txt
- run: brew test-bot --only-cleanup-after
- run: rm -rvf -- *.bottle*.{json,tar.gz}
- run: brew test-bot --only-setup --dry-run
- run: brew test-bot testbottest --only-formulae --dry-run