-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (140 loc) · 7.93 KB
/
cron.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# eslint-disable yml/no-empty-mapping-value
name: Cron
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: Enable debugging
required: false
default: false
push:
branches:
- main
- 'feature/**'
pull_request:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
# schedule:
# - cron: '*/5 * * * *'
jobs:
# Job ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
build:
name: job ❯ build & run
runs-on: ubuntu-24.04
steps:
# - name: Create Ramdrive
# run: |
# sudo mv /home/runner/work /home/runner/_work
# mkdir -p /home/runner/work
# sudo mount -o size=6G -t tmpfs none /home/runner/work
# sudo rsync -a /home/runner/_work/ /home/runner/work
# find . /home/runner/work
# - name: Benchmark1
# run: |
# curl -sL yabs.sh | bash -s -- -i -g
# ─────────────────────────────────────────────────────
- name: Bootstrap > Optimize fsync
run: |
echo "LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libeatmydata.so" >> $GITHUB_ENV
echo 'force-unsafe-io' | sudo tee -a /etc/dpkg/dpkg.cfg > /dev/null
echo -e '#!/bin/sh\nexec eatmydata /usr/bin/dpkg $@' | sudo tee /usr/local/bin/dpkg && sudo chmod +x /usr/local/bin/dpkg
echo -e '#!/bin/sh\nexec eatmydata /usr/bin/apt $@' | sudo tee /usr/local/bin/apt && sudo chmod +x /usr/local/bin/apt
echo -e '#!/bin/sh\nexec eatmydata /usr/bin/apt-get $@' | sudo tee /usr/local/bin/apt-get && sudo chmod +x /usr/local/bin/apt-get
sudo cp -p /bin/true /usr/bin/mandb 2> /dev/null || true
# ─────────────────────────────────────────────────────
- name: Bootstrap ❯❯ actions/checkout@v4
uses: actions/checkout@v4
with:
fetch-depth: 1
# ─────────────────────────────────────────────────────
# - name: Bootstrap ❯❯ denoland/setup-deno@v1
# uses: denoland/setup-deno@v1
# with:
# deno-version: v1.x
# ─────────────────────────────────────────────────────
- name: Bootstrap ❯❯ Set env variables
run: |
echo TEST_SECRET="${{ secrets.TEST_SECRET }}" >> $GITHUB_ENV
.github/scripts/ciutil set-env-variables
# ─────────────────────────────────────────────────────
- uses: actions/cache@v4
name: Bootstrap ❯❯ Restore Lockfile Cache
with:
path: ${{ env.ACTIONS_CACHE_DIR }}
key: ${{ runner.os }}-v1-store-${{ env.CACHE_PREFIX_DAILY }}-${{ hashFiles('**/deno.lock') }}
restore-keys: |
${{ runner.os }}-v1-store-${{ env.CACHE_PREFIX_DAILY }}-${{ hashFiles('**/deno.lock') }}
# ${{ runner.os }}-v1-store-${{ env.CACHE_PREFIX_DAILY }}-
# ${{ runner.os }}-v1-store-
- uses: actions/cache@v4
name: Bootstrap ❯❯ Restore TTL Cache
if: always()
with:
path: ${{ env.TTL_CACHE_DIR }}
key: ${{ runner.os }}-v1-ttl-cache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
${{ runner.os }}-v1-ttl-cache-${{ env.CACHE_PREFIX }}-
${{ runner.os }}-v1-ttl-cache-
# - uses: actions/cache@v4
# name: Bootstrap ❯❯ Restore Files Cache
# if: always()
# with:
# path: ${{ env.FILES_CACHE_DIR }}
# key: ${{ runner.os }}-v3-files-cache-${{ env.CACHE_PREFIX_DAILY }}-${{ hashFiles('**/package.json') }}
# restore-keys: |
# ${{ runner.os }}-v3-files-cache-${{ env.CACHE_PREFIX_DAILY }}-${{ hashFiles('**/package.json') }}
# ${{ runner.os }}-v3-files-cache-${{ env.CACHE_PREFIX_DAILY }}-
# ─────────────────────────────────────────────────────
- name: Bootstrap ❯❯ Preinstall & Prepare Environment
run: |
. .github/scripts/ciutil
✨ "Setup: Preinstall binaries" && preinstall-binaries
✨ "Debug: System information" && fastfetch --logo none --structure Title:Separator:OS:Host:Kernel:Uptime:Packages:Shell:CPU:GPU:Memory:Disk:Battery:PowerAdapter:Break:LocalIP:PublicIP --publicip-url icanhazip.com --publicip-timeout 200 || true
✨ "Debug: Env variables" && ga-dump-env
✨ "Debug: generic cache ($ACTIONS_CACHE_DIR)" && show-cache-structure-default
✨ "Debug: ttl cache ($TTL_CACHE_DIR)" && show-cache-structure-ttl
✨ "Debug: file cache ($FILES_CACHE_DIR)" && show-cache-structure-files
✨ "Debug: apt cache (/var/cache/apt/archives)" && show-cache-structure-apt
✨ "pnpm install" && install-nodemodules
✨ "Housekeeping:" && cron-housekeeping
# ─────────────────────────────────────────────────────
- uses: actions/checkout@v4
- name: Setup tmate session
if: ${{ runner.debug == '1' }}
uses: mxschmitt/action-tmate@v3
with:
detached: true
# ─────────────────────────────────────────────────────
- name: "✨ Docker ❯❯ Job1"
# if: github.event.schedule != '*/5 * * * *'
run: |
pstats docker run hello-world
# ─────────────────────────────────────────────────────
- name: "✨ Cron ❯❯ Job1"
# if: github.event.schedule != '*/5 * * * *'
run: |
cd .cron && just
# ─────────────────────────────────────────────────────
- name: Post hooks ❯❯ Commit to repository
if: github.ref == 'refs/heads/main'
run: |
.github/scripts/ciutil git-commit-to-repository
git push
# ─────────────────────────────────────────────────────
- name: "Debug ❯❯ Context Information"
id: github_context_step
env:
JSON_GITHUB: ${{ toJSON(github) }}
JSON_JOB: ${{ toJSON(job) }}
JSON_STEPS: ${{ toJSON(steps) }}
JSON_RUNNER: ${{ toJSON(runner) }}
JSON_STRATEGY: ${{ toJSON(strategy) }}
JSON_MATRIX: ${{ toJSON(MATRIX) }}
run: |
. .github/scripts/ciutil
ip-public
✨ "Debug: generic cache ($ACTIONS_CACHE_DIR)" && show-cache-structure-default
✨ "Debug: ttl cache ($TTL_CACHE_DIR)" && show-cache-structure-ttl
✨ "Debug: file cache ($FILES_CACHE_DIR)" && show-cache-structure-files
___
ga-dump-context # | tee /tmp/ga-dump-context.txt &> /dev/null && cat /tmp/ga-dump-context.txt