1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #15662 from miri64/gh-actions/fix/static-tests-base-ref

Github Actions: static-test: use base reference as base branch instead of master
This commit is contained in:
Martine Lenders 2021-01-06 12:33:41 +01:00 committed by GitHub
commit 264179d904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 7 deletions

View File

@ -4,6 +4,10 @@ on:
push:
branches:
- master
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:
- '*'
@ -21,14 +25,18 @@ jobs:
fetch-depth: 0
- name: Setup git
run: |
git fetch origin master:master_upstream --no-tags
# Note: ${{ github.base_ref }} is empty when not in a PR
if [ -n "${{ github.base_ref }}" ]; then
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} --no-tags
fi
git config apply.whitespace nowarn
- name: Fetch riot/riotbuild Docker image
run: docker pull riot/riotbuild:latest
- name: Run static-tests
run: |
# Note: ${{ github.base_ref }} is empty when not in a PR
docker run --rm \
-e CI_BASE_BRANCH=master_upstream \
-e CI_BASE_BRANCH=${{ github.base_ref }} \
-e GITHUB_RUN_ID=${GITHUB_RUN_ID} \
-v $(pwd):/data/riotbuild \
riot/riotbuild:latest \

View File

@ -95,7 +95,11 @@ if [ -n "${CI_BASE_COMMIT}" ]; then
git tag "${CI_BASE_BRANCH}" "${CI_BASE_COMMIT}"
fi
CI_BASE_BRANCH=${CI_BASE_BRANCH:-master}
if [ -z "${GITHUB_RUN_ID}" ]; then
# only default to master when not running in a GitHub action
# (so GitHub can check release branches too)
CI_BASE_BRANCH=${CI_BASE_BRANCH:-master}
fi
export BASE_BRANCH="${CI_BASE_BRANCH}"

View File

@ -12,6 +12,10 @@ CURDIR=$(cd "$(dirname "$0")" && pwd)
: "${WARNING:=1}"
. "$RIOTBASE"/dist/tools/ci/changed_files.sh
# tests/pkg_utensor/models/deep_mlp_weight.hpp is an auto-generated file
# with lots of commas so T009 takes very long. Since it is auto-generated, just
# exclude it.
EXCLUDE='^(.+/vendor/|dist/tools/coccinelle/include|dist/tools/fixdep/fixdep.c|dist/tools/lpc2k_pgm/src|tests/pkg_utensor/models)'
FILES=$(changed_files)
if [ -z "${FILES}" ]; then