Skip to content

Bug: dead code detection trips for fdefs with a const default parameter and no callsites #2932

Bug: dead code detection trips for fdefs with a const default parameter and no callsites

Bug: dead code detection trips for fdefs with a const default parameter and no callsites #2932

name: Check for Broken Links and Publish Wiki
'on':
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ main ]
workflow_dispatch:
workflow_run:
workflows: ["Release Action"]
branches: [ main ]
types:
- completed
schedule:
# every monday at night
- cron: '0 1 * * 1'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "🛒 Checkout Repository (Release Perm. with lfs)"
if: ${{ (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && !failure() }}
uses: actions/checkout@v6
with:
submodules: true
lfs: true
token: ${{ secrets.RELEASE_TOKEN }}
fetch-tags: true
fetch-depth: 0
- name: "🛒 Checkout Repository (Read Perm.)"
if: ${{ !((github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main'))) || failure() }}
uses: actions/checkout@v6
with:
submodules: true
lfs: false
token: ${{ secrets.RELEASE_TOKEN }}
fetch-tags: false
fetch-depth: 0
- name: "🌍 Load Versions to Use"
id: doc-global-versions
run: bash .github/workflows/scripts/global-configuration.sh
- name: "⬇️ Use Node.js"
uses: actions/setup-node@v6
with:
node-version: ${{ env.ACTION_NODE_VERSION }}
registry-url: "https://registry.npmjs.org/"
- name: "⬇️ Setup R"
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ env.ACTION_R_VERSION }}
use-public-rspm: true
- name: "📦 Install R Packages"
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache: 'true'
cache-version: '1'
extra-packages: |
any::xmlparsedata
any::dplyr
any::readr
- name: "🛒 Checkout LFS"
if: ${{ (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && !failure() }}
# just as a time-proven safety measure
run: git lfs checkout
- name: "⚗️ Test Suite (full, for data)"
# we make sure we have a clean run
run: |
rm -rf "coverage/"
rm -f "/tmp/flowr-label-summary.json"
bash .github/workflows/scripts/run-flowr-command.sh "test-full -- --allowOnly=false"
- name: "🛠️ Update the Generated Pages"
run: |
# npm ci is done by the full test run before
CHANGED_ANY=false
CHANGED_FILES=()
# Generate all wiki pages
npm run wiki
# read in everything from /tmp/flowr-wiki-changed-files.txt and add to CHANGED_FILES
if [ -f /tmp/flowr-wiki-changed-files.txt ]; then
while IFS= read -r line; do
CHANGED_FILES+=("$line")
done < /tmp/flowr-wiki-changed-files.txt
fi
if [ ${#CHANGED_FILES[@]} -gt 0 ]; then
echo "The following Wiki pages were changed:"
for file in "${CHANGED_FILES[@]}"; do
echo "- $file"
git add -f "$file"
done
CHANGED_ANY=true
echo "CHANGED=true" >> $GITHUB_ENV
else
echo "No Wiki pages were changed!"
fi
echo "====== Producing Update (if necessary) ======"
# check for an update in the versions! (including the updated name information)
LIMIT_TO_LAST=8
ALL_TAGS=$( git tag --list --format="%(tag) (%(creatordate))" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | sed -E 's/^(v[0-9]+\.[0-9]+\.[0-9]+)\s*\(([a-zA-Z]+\s*)([a-zA-Z]+)\s*([0-9]+)\s*[0-9:]+\s+([0-9]+).*/\1 (\3 \4, \5)/' | sort -V | tail -n$LIMIT_TO_LAST)
NUM_OF_TAGS=$(echo "$ALL_TAGS" | wc -l)
LATEST_TAG=$(echo "$ALL_TAGS" | tail -n1)
# add (latest) to the latest tag
ALL_TAGS=$(sed -E "s/^$LATEST_TAG$/$LATEST_TAG (latest)/" <<< "$ALL_TAGS")
ALL_TAGS=$(echo -e "<Older> (please consider updating)\n$ALL_TAGS")
ALL_TAGS+="\nUnknown\nUnreleased/Dev"
ALL_TAGS=$(echo -e "$ALL_TAGS" | sed -E 's/^(.*)$/ - \1/')
cp .github/ISSUE_TEMPLATE/bug-report.yaml .github/ISSUE_TEMPLATE/bug-report.yaml.tmp
sed -i -E "/\s*# START::Versions/,/\s*# END::Versions/c\\# START::Versions\n$(echo "$ALL_TAGS" | sed 's/$/\\/' ) \n# END::Versions" .github/ISSUE_TEMPLATE/bug-report.yaml
sed -i -E "/\s*# START::DefaultVersion/,/\s*# END::DefaultVersion/c\\# START::DefaultVersion\n default: $((NUM_OF_TAGS))\n# END::DefaultVersion" .github/ISSUE_TEMPLATE/bug-report.yaml
if ! diff -q .github/ISSUE_TEMPLATE/bug-report.yaml .github/ISSUE_TEMPLATE/bug-report.yaml.tmp; then
echo "Versions in the bug-report changed!"
echo "CHANGED=true" >> $GITHUB_ENV
CHANGED_ANY=true
git add -f .github/ISSUE_TEMPLATE/bug-report.yaml
CHANGED_FILES+=("bug-report.yaml")
else
echo "Versions in bug-report did not change!"
fi
echo "====== Make Commit (if necessary) ======"
if [ $CHANGED_ANY == "true" ]; then
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git config lfs.allowincompletepush true
CHANGED_FILES_STRING=$(IFS=,; echo "${CHANGED_FILES[*]}")
git commit -m "[skip ci] doc: update generated wiki pages ($CHANGED_FILES_STRING)"
fi
- name: "⬆️ Push changed Wiki pages"
if: ${{ env.CHANGED == 'true' && (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && !failure() }}
uses: ad-m/github-push-action@master
with:
branch: main
github_token: ${{ secrets.RELEASE_TOKEN }}
force: true
- name: "⬆️ Publish the Wiki"
uses: Andrew-Chen-Wang/github-wiki-action@v4
# We do not need to republish if nothing changes. Furthermore, do not publish on PR as this should be done by the push on main!
if: ${{ (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && !failure() }}
with:
path: "wiki/"
strategy: 'init'
token: ${{ secrets.GH_DEPLOY_WIKI }}
ignore: |
**/*.md.tmp
**/*-Old.*
- name: "🔎 Check the Wiki pages and README for broken links"
uses: becheran/mlc@v1
continue-on-error: true
if: ${{ (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && !failure() }}
with:
args: --do-not-warn-for-redirect-to "http*://github.com/flowr-analysis/*,http*://flowr-analysis.github.io/*" --ignore-links "http*://hub.docker.com/r/*" wiki/ README.md