Skip to content

fix(module-functions): properly handle if disabled #220

fix(module-functions): properly handle if disabled

fix(module-functions): properly handle if disabled #220

Workflow file for this run

name: Check
on:
pull_request:
push:
branches:
- master
paths-ignore:
- "README.md"
- "TODO.md"
- ".gitignore"
env:
QUOTE_URL: https://quotes-github-readme.vercel.app/api?type=horizontal&theme=dark&author=Sun%20Tzu,%20The%20Art%20of%20War&quote=
AUTHOR: yunfachi
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install Nix ❄️"
uses: cachix/install-nix-action@v22
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: "Check NixOS flake ❄️"
id: flake_check
#uses: mathiasvr/[email protected]
run: |
nix flake check --accept-flake-config --show-trace 2>&1 | tee check.log
result_code=${PIPESTATUS[0]}
result="$(cat check.log)"
if [ $result_code -eq 0 ]; then
QUOTE_TYPE="SUCCESS"
else
QUOTE_TYPE="FAILURE"
fi
if [[ $result == *"in pure evaluation mode (use '--impure' to override)"* ]]; then
QUOTE_TYPE="IMPURE"
elif [[ $result == *"error: infinite recursion encountered"* ]]; then
QUOTE_TYPE="INFINITE_RECURSION"
fi
echo "QUOTE_TYPE=${QUOTE_TYPE}" >> $GITHUB_OUTPUT
printf "<details>\n <summary>Log - %s</summary>\n\n \`\`\`nix %s\n \`\`\`\n</details>" "${QUOTE_TYPE,,}" "${result}" > $GITHUB_STEP_SUMMARY
exit $result_code
- name: "Log success"
if: success()
env:
QUOTE_SUCCESS1: "Victorious warriors win first and then go to war, while defeated warriors go to war first and then seek to win. In the realm of code, the triumphant developer ensures purity, conquering bugs before embarking on the path to success."
QUOTE_SUCCESS2: "In the realm of achievements, success is the symphony played by the harmonious collaboration of strategy, diligence, and foresight. As Sun Tzu observed, true victory is woven in the fabric of meticulous planning and flawless execution."
QUOTE_SUCCESS3: "Success in any endeavor mirrors the wisdom of Sun Tzu's teachings - a delicate dance between preparation and execution. The victorious navigate the challenges with grace, crafting triumph through the mastery of principles rather than the mere strokes of a keyboard."
QUOTE_SUCCESS4: "In the tapestry of accomplishments, success is the vibrant thread woven by the hands of skill and determination. As Sun Tzu wisely declared, true victory emerges when challenges are met with a resilient spirit and an unwavering commitment to excellence."
QUOTE_SUCCESS5: "Success, according to Sun Tzu's timeless wisdom, is the culmination of strategic insight, relentless effort, and the artful navigation of obstacles. In the coding arena, triumph belongs to those who embrace the journey with both precision and passion."
run: |
printf '<img src="%s%s" alt="success" height="10000"/>' "${QUOTE_URL}" $(jq -rn --arg x "$(eval echo \$QUOTE_SUCCESS$((1+RANDOM%$(compgen -v | grep -c '^QUOTE_SUCCESS'))))" '$x|@uri') >> $GITHUB_STEP_SUMMARY
- name: "Log failure"
if: failure()
env:
QUOTE_FAILURE1: "In the code's symphony, an unhandled failure is a discordant note that disrupts the melody of success. Sun Tzu's wisdom reminds us, 'To confront an unknown error is to face the chaos within; the victorious developer conquers the dissonance with strategic precision.'"
QUOTE_FAILURE2: "Sun Tzu's teachings reverberate in the digital battlefield: 'An unhandled failure is a silent storm that wreaks havoc on the architecture of triumph. Navigate the unknown errors with resilience, for victory belongs to those who master the unforeseen.'"
QUOTE_FAILURE3: "In the realm of coding, an unhandled failure is the shadow that eclipses the light of success. Sun Tzu wisely counsels, 'To grapple with the unknown error is to challenge the abyss; fortify your code, for in darkness lies the path to victory.'"
QUOTE_FAILURE4: "Sun Tzu's insight illuminates the coding journey: 'An unhandled failure is the uncharted territory where defeat lurks in the shadows. Conquer the unknown errors with unwavering resolve, for triumph belongs to those who face the abyss.'"
QUOTE_FAILURE5: "In the tapestry of code, an unhandled failure is the thread that threatens to unravel the fabric of accomplishment. Sun Tzu guides us, 'To encounter an unknown error is to stand at the crossroads; fortify your code, for the path to victory is paved with strategic mastery.'"
QUOTE_IMPURE1: "In the code's purity lies its strength. Sun Tzu reminds us that an impure foundation crumbles beneath the weight of errors. To safeguard victory, purify your codebase and fortify against the impending chaos."
QUOTE_IMPURE2: "Sun Tzu's wisdom echoes through the corridors of coding: 'An impure architecture is a fertile ground for bugs, a sanctuary for chaos. Purification is the shield that guards against the relentless onslaught of errors.'"
QUOTE_IMPURE3: "In the art of coding warfare, an impure structure is a Trojan horse inviting bugs to infiltrate the sanctity of your logic. As Sun Tzu admonishes, 'To secure success, fortify your code with purity and let no impurity compromise the kingdom.'"
QUOTE_IMPURE4: "Sun Tzu's guidance resonates in the digital realm: 'An impure codebase is a gateway for errors, a breach in the walls of accomplishment.' Victory is reserved for those who purify their algorithms and repel the invaders."
QUOTE_IMPURE5: "The coding battlefield demands purity as its armor. Sun Tzu's wisdom cautions against the impure, where bugs breed and victory becomes an elusive mirage. Purge impurities, and your code shall stand as an impervious fortress."
QUOTE_INFINITE_RECURSION1: "In the coding symphony, infinite recursion is the elusive melody that threatens to drown triumph in its ceaseless dance. Sun Tzu warns, 'To grapple with the recursive unknown is to face the abyss; victory belongs to those who break free from the eternal embrace.'"
QUOTE_INFINITE_RECURSION2: "Sun Tzu's insight extends to the digital labyrinth: 'Infinite recursion is the enigma that tests the coder's mastery. Navigate the recursive depths with strategic clarity, for triumph lies in breaking the chains of the endless repetition.'"
QUOTE_INFINITE_RECURSION3: "In the coding saga, infinite recursion is the silent adversary that challenges the very essence of success. Sun Tzu advises, 'To confront the recursive puzzle is to stand at the crossroads of victory; fortify your code, for in breaking free lies the path to triumph.'"
QUOTE_INFINITE_RECURSION4: "Sun Tzu's wisdom echoes in the digital symphony: 'Infinite recursion is the dissonant note that threatens the harmony of accomplishment. Conquer the recursive abyss with unwavering resolve, for victory belongs to those who master the challenges.'"
QUOTE_INFINITE_RECURSION5: "In the tapestry of code, infinite recursion is the thread that weaves a pattern of perpetual challenge. Sun Tzu guides us, 'To navigate the recursive labyrinth is to confront the coding unknown; fortify your logic, for breaking free from the endless repetition is the path to triumph.'"
run: |
QUOTE_TYPE="${{ steps.flake_check.outputs.QUOTE_TYPE }}"
printf '<img src="%s%s" alt="%s" height="10000"/>' "${QUOTE_URL}" "$(jq -rn --arg x "$(eval echo \$QUOTE_${QUOTE_TYPE}$((1+RANDOM%$(compgen -v | grep -c "^QUOTE_${QUOTE_TYPE}"))))" '$x|@uri')" "${QUOTE_TYPE,,}" > $GITHUB_STEP_SUMMARY