Skip to content

Node.js CI

Node.js CI #6955

Workflow file for this run

# 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'