Node.js CI #6951
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# eslint-disable yml/no-empty-mapping-value | |
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Node.js CI | |
on: | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
type: boolean | |
description: Enable debugging | |
required: false | |
default: false | |
push: | |
branches: [main] | |
pull_request: | |
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
schedule: | |
- cron: '5 */2 * * *' | |
jobs: | |
# Job ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
build: | |
name: job β― build & run | |
runs-on: ubuntu-22.04 | |
steps: | |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
- name: Github β― actions/checkout@v4 | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
fetch-depth: 1 | |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
- name: Bootstrap β― Set env variables | |
run: | | |
.github/scripts/helpers set-env-variables | |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
- name: Bootstrap β― Prepare Environment | |
run: | | |
. .github/scripts/helpers | |
mkdir -p ~/.local/bin | |
show-system-information | |
dump-env | |
___ | |
helpers create-directories | |
helpers optimize-ubuntu & | |
helpers install-pnpm-binary & | |
helpers install-static-binaries & | |
wait | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# - uses: actions/cache@v4 | |
# name: Bootstrap β― Restore Cache | |
# with: | |
# path: ${{ env.ACTIONS_CACHE_DIR }} | |
# key: ${{ runner.os }}-v1-pnpm-store-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('.github/scripts/deps') }} | |
# restore-keys: | | |
# ${{ runner.os }}-v1-pnpm-store-${{ env.CACHE_PREFIX }}- | |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
- name: Bootstrap β― Install dependencies | |
run: pstats .github/scripts/deps | |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
- name: Just β― cron/download-static-binaries | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: ./cron/download | |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
- name: Post hooks β― Commit to repository | |
if: github.ref == 'refs/heads/main' | |
run: | | |
git add . --verbose | |
stats=$(git diff --cached --shortstat | sed -E 's/ (insertions|deletions)//g') | |
git commit -m "β‘οΈ CI: $stats [skip ci]" -a || true | |
git push | |
# # βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
# - name: "Debug: Context Information" | |
# id: github_context_step | |
# if: github.ref == 'refs/heads/main' | |
# run: | | |
# helpers show-cache-folders | |
# helpers show-cache-structure | |
# mkdir -p $CONTEXT_DIR &> /dev/null | |
# echo '${{ toJSON(github) }}' >> $CONTEXT_DIR/github.json & | |
# echo '${{ toJSON(job) }}' >> $CONTEXT_DIR/job.json & | |
# echo '${{ toJSON(steps) }}' >> $CONTEXT_DIR/steps.json & | |
# echo '${{ toJSON(runner) }}' >> $CONTEXT_DIR/runner.json & | |
# echo '${{ toJSON(strategy) }}' >> $CONTEXT_DIR/strategy.json & | |
# echo '${{ toJSON(matrix) }}' >> $CONTEXT_DIR/matrix.json & | |
# wait | |
# pstats helpers 'dump-context' |