forked from Homebrew/homebrew-test-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (109 loc) · 4.54 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI
on:
push:
branches: master
pull_request:
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
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@v1
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-
- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems
- run: brew test-bot --only-cleanup-before
- run: brew test-bot --only-setup
- run: brew test-bot --only-tap-syntax
- name: Set up Ruby
if: matrix.os == 'ubuntu-latest'
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.6"
bundler-cache: true
- name: Install Homebrew/homebrew-test-bot RubyGems
if: matrix.os == 'macOS-latest'
run: bundle install --jobs 4 --retry 3
- name: Run Homebrew/homebrew-test-bot RSpec tests
run: bundle exec rspec
- name: Build Docker image and start container
if: matrix.os == 'ubuntu-latest'
run: |
docker build -t brew .
docker create \
-e GITHUB_ACTIONS -e GITHUB_BASE_REF -e GITHUB_REF -e GITHUB_REPOSITORY -e GITHUB_SHA \
--name=brewtestbot brew sleep infinity
docker start brewtestbot
- run: brew test-bot --only-formulae-detect --test-default-formula
id: formulae-detect
- name: Run brew test-bot --only-formulae --junit --only-json-tab --skip-dependents --testing-formulae=${{ steps.formulae-detect.outputs.testing_formulae }}
id: brew-test-bot-formulae
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
docker exec brewtestbot \
brew test-bot --only-formulae --junit --only-json-tab --skip-dependents --testing-formulae=${{ steps.formulae-detect.outputs.testing_formulae }}
else
brew test-bot --only-formulae --junit --only-json-tab --skip-dependents --testing-formulae=${{ steps.formulae-detect.outputs.testing_formulae }}
fi
- name: Run brew test-bot --only-formulae-dependents --junit --skipped-or-failed-formulae=${{ steps.brew-test-bot-formulae.outputs.skipped_or_failed_formulae }}
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
docker exec brewtestbot \
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 }}
else
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 }}
fi
- name: Output brew test-bot failures
if: matrix.os == 'macOS-latest'
run: |
cat steps_output.txt
rm steps_output.txt
- name: Output brew bottle output
if: matrix.os == 'macOS-latest'
run: |
cat bottle_output.txt
rm bottle_output.txt
- name: Run brew test-bot --only-cleanup-after
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
docker exec brewtestbot \
brew test-bot --only-cleanup-after
else
brew test-bot --only-cleanup-after
fi
- name: Run brew test-bot --only-setup --dry-run
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
docker exec brewtestbot \
brew test-bot --only-setup --dry-run
else
brew test-bot --only-setup --dry-run
fi
- name: Run brew test-bot testbottest --only-formulae --dry-run
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
docker exec brewtestbot \
brew test-bot testbottest --only-formulae --dry-run
else
brew test-bot testbottest --only-formulae --dry-run
fi
- name: Cleanup Docker container
if: matrix.os == 'ubuntu-latest'
run: |
docker stop brewtestbot
docker rm brewtestbot