Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions .github/workflows/static-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,40 @@ jobs:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: set CI_BASE_BRANCH
- 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
# Figure out the correct base branch to work on...

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

echo "Base Branch: origin/$(grep '^CI_BASE_BRANCH=' $GITHUB_ENV | cut -d= -f2-)"
- name: Setup git
run: |
# Configuring and rebasing the repository...

# Name and E-Mail required for rebasing
git config user.name "statictester"
git config user.email "statictester@riot.invalid"

# 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
echo "Rebasing PR branch onto origin/${CI_BASE_BRANCH}..."
git rebase origin/${CI_BASE_BRANCH}
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
- name: Run static-tests on `riot/static-test-tools`
run: |
# Start docker container and run tests...

# Note: ${CI_BASE_BRANCH} is empty when not in a PR
docker run --rm \
-e CI_BASE_BRANCH \
Expand Down
Loading