File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 1+ /Requirements: / { in_section= 1 ; next }
2+ in_section && /^ - / { print substr ($0 , 3 ); last_dep= NR }
3+ NR > last_dep && in_section { exit }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ cache_dir=" ${HOME} /apt-cache"
4+ cache_option=" Dir::Cache::Archives=${cache_dir} "
5+
6+ mkdir -p " $cache_dir "
7+ sudo apt -o " $cache_option " update
8+ sudo apt -o " $cache_option " install -y clang
9+ sudo xargs -a apt-deps.txt apt -o " $cache_option " install -y
10+ sudo rm -rf " ${cache_dir} /partial" " ${cache_dir} /lock"
Original file line number Diff line number Diff line change @@ -12,24 +12,14 @@ jobs:
1212 steps :
1313 - uses : actions/checkout@v5
1414 - name : Find dependency list
15- run : |
16- awk '
17- /Requirements:/ { in_section=1; next }
18- in_section && /^- / { print substr($0, 3); last_dep=NR }
19- NR > last_dep && in_section { exit }
20- ' README.md > apt-deps.txt
21- cat apt-deps.txt
15+ run : awk -f ./.github/scripts/extract_dependencies.awk README.md | tee apt-deps.txt
2216 - name : Cache apt packages
2317 uses : actions/cache@v4
2418 with :
2519 path : ~/apt-cache
2620 key : ${{ runner.os }}-apt-${{ hashFiles('apt-deps.txt') }}
2721 - name : Install dependencies with cache
28- run : |
29- mkdir -p $HOME/apt-cache
30- sudo apt-get -o Dir::Cache::Archives="$HOME/apt-cache" update
31- sudo apt-get -o Dir::Cache::Archives="$HOME/apt-cache" install -y clang $(cat apt-deps.txt)
32- sudo rm -rf $HOME/apt-cache/partial $HOME/apt-cache/lock
22+ run : bash ./.github/scripts/fetch_dependencies.sh
3323 - run : clang nob.c -o nob
3424 - name : Build with default configuration
3525 run : ./nob
3828 env :
3929 WPC_HELPER : 0
4030 - name : Build using Clang instead of GCC
41- run : |
31+ run : |-
4232 sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
4333 ./nob
You can’t perform that action at this time.
0 commit comments