-
Notifications
You must be signed in to change notification settings - Fork 457
102 lines (87 loc) · 2.66 KB
/
tests-self-hosted.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
name: GitHub Actions CI (self-hosted)
on:
pull_request:
paths-ignore:
- "Formula/patchelf.rb"
- "Formula/binutils.rb"
env:
HOMEBREW_DEVELOPER: 1
HOMEBREW_GITHUB_ACTIONS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED: 1
jobs:
tap_syntax:
if: github.repository == 'Homebrew/linuxbrew-core' && contains(github.event.pull_request.labels.*.name, 'self-hosted-ci')
runs-on: ubuntu-latest
env:
HOMEBREW_FORCE_HOMEBREW_ON_LINUX: 1
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Cache Bundler RubyGems
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 Bundler RubyGems
run: brew install-bundler-gems
- run: brew test-bot --only-tap-syntax
cleanup:
needs: tap_syntax
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'Merge') == false
runs-on: self-hosted
steps:
- name: Cleanup
run: sudo rm -rf "${{ github.workspace }}"
tests:
needs: cleanup
runs-on: self-hosted
timeout-minutes: 4320
container:
image: homebrew/ubuntu16.04:master
env:
HOMEBREW_PATCHELF_RB: 1
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: brew test-bot --only-cleanup-before
- run: rm steps_output.txt
- run: brew test-bot --only-setup
- name: Run brew test-bot --only-formulae
run: |
mkdir ~/bottles
cd ~/bottles
brew test-bot --only-formulae --keep-old
- name: Upload logs
if: failure()
uses: actions/upload-artifact@main
with:
name: logs (Linux)
path: ~/bottles/logs
- name: Delete logs and home
if: always()
run: |
rm -rvf ~/bottles/logs
rm -rvf ~/bottles/home
- name: Count bottles
id: bottles
if: always()
run: |
cd ~/bottles
count=$(ls *.json | wc -l | xargs echo -n)
echo "$count bottles"
echo "::set-output name=count::$count"
- name: Upload bottles
if: always() && steps.bottles.outputs.count > 0
uses: actions/upload-artifact@main
with:
name: bottles
path: ~/bottles
- run: brew test-bot --only-cleanup-after
if: always()
- name: Post Cleanup
if: always()
run: rm -rvf ~/bottles