forked from RIOT-OS/RIOT
-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (49 loc) · 1.58 KB
/
static-test.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
name: static-tests
on:
push:
branches:
- master
- staging
- trying
tags:
- '[0-9][0-9][0-9][0-9].[0-9][0-9]-RC[0-9]*'
- '[0-9][0-9][0-9][0-9].[0-9][0-9]'
- '[0-9][0-9][0-9][0-9].[0-9][0-9].*'
pull_request:
branches:
- '*'
merge_group:
jobs:
static-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: set CI_BASE_BRANCH
run: |
if [ -n "${{ github.base_ref }}" ]; then
echo "CI_BASE_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
elif [ -n "${{ github.event.merge_group.base_ref }}" ]; then
echo "CI_BASE_BRANCH=${{ github.event.merge_group.base_ref }}" | sed s.=refs/heads/.=. >> $GITHUB_ENV
fi
- name: Setup git
run: |
# Note: CI_BASE_BRANCH is empty when not in a PR
if [ -n "${CI_BASE_BRANCH}" ]; then
git fetch origin ${CI_BASE_BRANCH}:${CI_BASE_BRANCH} --no-tags
else
git config diff.renameLimit 16384
fi
git config apply.whitespace nowarn
- name: Fetch riot/static-test-tools Docker image
run: docker pull riot/static-test-tools:latest
- name: Run static-tests
run: |
# Note: ${CI_BASE_BRANCH} is empty when not in a PR
docker run --rm \
-e CI_BASE_BRANCH \
-e GITHUB_RUN_ID=${GITHUB_RUN_ID} \
-v $(pwd):/data/riotbuild \
riot/static-test-tools:latest \
make static-test