8
8
pull_request :
9
9
branches :
10
10
- master
11
+ schedule :
12
+ - cron : " 0 5 * * *"
11
13
12
14
concurrency :
13
15
group : unit-${{ github.head_ref }}
17
19
pre-commit :
18
20
runs-on : ubuntu-latest
19
21
if : >
20
- github.event.pull_request.draft == false &&
21
- !contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
22
- !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')
22
+ (github.event.pull_request.draft == false &&
23
+ !contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
24
+ !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) ||
25
+ github.event_name == 'schedule'
23
26
steps :
24
27
# Run only in this repository
25
28
- name : Get GitHub App token
37
40
token : ${{ steps.get_token.outputs.token }}
38
41
- uses : actions/setup-python@v4
39
42
with :
40
- python-version : ' 3.10 '
43
+ python-version : ' 3.11 '
41
44
# Fetch a fork of the repo
42
45
- uses : actions/checkout@v3
43
46
if : github.event.pull_request.head.repo.full_name != github.repository
48
51
run : python -m pip install pre-commit
49
52
- name : set PY
50
53
run : echo "PY=$(python -c 'import hashlib, sys, platform;print(hashlib.sha256(platform.python_version().encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
51
- - uses : actions/cache@v2
54
+ - uses : actions/cache@v3
52
55
with :
53
56
path : ~/.cache/pre-commit
54
57
key : pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
@@ -71,20 +74,19 @@ jobs:
71
74
exit 1
72
75
env :
73
76
HEAD_REF : ${{ github.event.pull_request.head.ref }}
77
+ - id : pre_commit_schedule
78
+ name : Run pre-commit in schedule
79
+ if : github.event_name == 'schedule'
80
+ run : |
81
+ pre-commit run --all-files --show-diff-on-failure --color=always
74
82
75
83
test :
76
84
strategy :
77
85
matrix :
78
86
node-version : ["16", "18"]
79
- platform : [ubuntu-latest] # , macos-latest, windows-latest]
80
- # test only latest version on macos and windows
81
- # exclude:
82
- # - platform: macos-latest
83
- # node-version: '12'
84
- # - platform: windows-latest
85
- # node-version: '12'
87
+ platform : [ubuntu-latest]
86
88
runs-on : ${{ matrix.platform }}
87
- if : github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')
89
+ if : ( github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) || github.event_name == 'schedule'
88
90
steps :
89
91
- uses : actions/checkout@v3
90
92
- name : Set up Node ${{ matrix.node-version }}
98
100
99
101
examples :
100
102
runs-on : ubuntu-latest
101
- if : github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')
103
+ if : ( github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) || github.event_name == 'schedule'
102
104
steps :
103
105
- uses : actions/checkout@v3
104
106
- name : Set up Node 16
0 commit comments