Update makefile.yml #15
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
name: Build and Test ch01_bootsector | |
on: | |
push: | |
branches: [ "main", "ci" ] | |
pull_request: | |
branches: [ "main", "ci" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up environment | |
run: | | |
export CHOOSENIM_NO_ANALYTICS=1 | |
export CHOOSENIM_CHOOSE_VERSION=stable | |
curl -sL https://nim-lang.org/choosenim/init.sh | sh -s -- -y | |
# Add Nimble binaries to PATH | |
export PATH="$HOME/.nimble/bin:$PATH" | |
sudo apt-get update | |
sudo apt-get install -y nasm make xxd gcc | |
- name: Checkout code 2 | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libncurses5 libx11-dev libxext-dev libxrender-dev libxrandr-dev libxfixes-dev | |
- name: Install FreeBASIC | |
run: | | |
FB_VERSION="1.10.1" | |
curl -LO "http://downloads.sourceforge.net/fbc/FreeBASIC-1.10.1-linux-x86_64.tar.xz?download" | |
tar -xf "FreeBASIC-1.10.1-linux-x86_64.tar.xz" | |
mv /opt/FreeBASIC-1.10.1-linux-x86_64 | |
export PATH="/opt/FreeBASIC-1.10.1-linux-x86_64/bin:${PATH}" | |
fbc --version | |
# Install V | |
curl -s https://raw.githubusercontent.com/vlang/v/master/install.sh | bash | |
export PATH="$HOME/.vlang/bin:$PATH" | |
echo "Environment setup completed." | |
- name: Build and Test in Subdirectories | |
run: | | |
for dir in ch01_bootsector/*; do | |
if [ -d "$dir" ]; then | |
echo "Building in directory: $dir" | |
cd "$dir" | |
make clean || true | |
make || { echo "Build failed in $dir"; exit 1; } | |
echo "Build succeeded in $dir" | |
cd - | |
fi | |
done |