forked from sofa-framework/sofa
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (69 loc) · 2.88 KB
/
reboot_builders.yml
File metadata and controls
81 lines (69 loc) · 2.88 KB
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
name: Reboot builders
# ===============================================================
# ===============================================================
on:
# On-demand binary generation
workflow_dispatch:
inputs:
builder-os:
type: choice
description: On which OS run the binaries generation
options:
- '["sofa-ci-dev-ubuntu2204-0"]'
- '["sofa-ci-dev-ubuntu2204-1"]'
- '["sofa-ci-dev-ubuntu2204-2"]'
- '["sofa-ci-dev-ubuntu2204-3"]'
- '["sofa-ci-dev-ubuntu2204-4"]'
- '["consortium-macos-2-1"]'
- '["consortium-macos-3-1"]'
- '["sofa-ci-dev-ubuntu2204-0","sofa-ci-dev-ubuntu2204-1","sofa-ci-dev-ubuntu2204-2","sofa-ci-dev-ubuntu2204-3","sofa-ci-dev-ubuntu2204-4","consortium-macos-2-1","consortium-macos-3-1"]'
default: '["sofa-ci-dev-ubuntu2204-0","sofa-ci-dev-ubuntu2204-1","sofa-ci-dev-ubuntu2204-2","sofa-ci-dev-ubuntu2204-3","sofa-ci-dev-ubuntu2204-4","consortium-macos-2-1","consortium-macos-3-1"]'
# Nightly build
schedule:
- cron: '30 1 * * *' # Evevery night @1:30 a.m.
# ===============================================================
# ===============================================================
jobs:
# Filter build handling : push in master, commits in PR, comments in PR and dispatch
reboot_builders_by_hand:
if: ${{ github.event_name != 'schedule'}}
strategy:
fail-fast: false
matrix:
os: ${{ fromJson(inputs.builder-os) }}
runs-on: ${{ matrix.os }}
steps:
- name: Clear ccache
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
if [[ -n "$BUILDER_CACHE_DIR" ]]; then
rm -rf $BUILDER_CACHE_DIR/*
fi
- name: Reboot builder
shell: bash
run: |
# WARNING: this command needs to add in /etc/sudoers this line:
# ALL ALL=NOPASSWD: /usr/sbin/reboot, /usr/sbin/shutdown, /sbin/reboot, /sbin/shutdown
echo '' | sudo -S /sbin/shutdown -r +1 &
rebot_builder_nightly:
if: ${{ github.event_name == 'schedule'}}
strategy:
fail-fast: false
matrix:
os: ["sofa-ci-dev-ubuntu2204-0","sofa-ci-dev-ubuntu2204-1","sofa-ci-dev-ubuntu2204-2","sofa-ci-dev-ubuntu2204-3","sofa-ci-dev-ubuntu2204-4","consortium-macos-2-1","consortium-macos-3-1"]
runs-on: ${{ matrix.os }}
steps:
- name: Clear ccache
if: ${{ runner.os == 'Linux' }}
shell: bash
run: |
if [[ -n "$BUILDER_CACHE_DIR" ]]; then
rm -rf $BUILDER_CACHE_DIR/*
fi
- name: Reboot builder
shell: bash
run: |
# WARNING: this command needs to add in /etc/sudoers this line:
# ALL ALL=NOPASSWD: /usr/sbin/reboot, /usr/sbin/shutdown, /sbin/reboot, /sbin/shutdown
echo '' | sudo -S /sbin/shutdown -r +1 &