examples, ui: comment all bugged code and submit as-is #150
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: Code CI | |
on: | |
push: | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
concurrency: | |
group: general-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
code-formatting: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
VFLAGS: -cc tcc | |
steps: | |
- name: Checkout V | |
uses: actions/checkout@v2 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make -j4 && sudo ./v symlink | |
- name: Checkout shy | |
uses: actions/checkout@v2 | |
with: | |
path: shy | |
- name: Test code formatting | |
run: | | |
cd shy | |
v test-fmt | |
# TODO this makes formatting checks fail? | |
#- name: Simulate "v install shy" | |
# run: mv shy ~/.vmodules | |
- name: Symlink as module | |
run: sudo ln -s $(pwd)/shy ~/.vmodules/shy # Workaround for doing `mv shy ~/.vmodules` | |
- name: Build shy with -skip-unused | |
run: v -skip-unused ~/.vmodules/shy | |
- name: Build shy | |
run: v -g ~/.vmodules/shy | |
- name: Symlink shy command | |
run: sudo ln -s ~/.vmodules/shy/shy /usr/local/bin/shy | |
# TODO broken with $embed_file | |
#- name: Test clean shy code | |
# run: | | |
# shy test-cleancode ~/.vmodules/shy | |
ubuntu-latest-bootstrap: | |
runs-on: ubuntu-20.04 # use 20.04 for now (SDL2 compile issue) | |
timeout-minutes: 20 | |
env: | |
VFLAGS: -cc tcc -no-retry-compilation | |
SDL2_VERSION: 2.0.8 | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev | |
sudo apt-get install --quiet -y libsdl2-mixer-dev libsdl2-image-dev | |
curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz -o SDL2.tar.gz | |
tar -zxvf SDL2.tar.gz | |
- name: Build SDL | |
run: | | |
cd SDL2-${SDL2_VERSION} | |
mkdir build | |
cd build | |
../configure --prefix /tmp/sdl2-${SDL2_VERSION} | |
make | |
make install | |
- name: Checkout V | |
uses: actions/checkout@v2 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make -j4 && sudo ./v symlink | |
- name: Install sdl module | |
run: v install sdl | |
- name: Checkout shy | |
uses: actions/checkout@v2 | |
with: | |
path: shy | |
- name: Simulate "v install shy" | |
run: mv shy ~/.vmodules | |
- name: Run tests | |
run: v test ~/.vmodules/shy | |
- name: Build shy with -prod | |
run: v -prod ~/.vmodules/shy | |
- name: Build shy | |
run: v -g ~/.vmodules/shy | |
- name: Symlink shy | |
run: sudo ln -s ~/.vmodules/shy/shy /usr/local/bin/shy | |
- name: Run 'shy --help' | |
run: shy --help | |
- name: Run 'shy doctor' | |
run: shy doctor | |
- name: Test shy complete | |
run: | | |
[ "$(shy complete bash shy com)" = "COMPREPLY+=('complete')" ] | |
- name: Build shy example | |
run: | | |
export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags)" | |
export LDFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --libs)" | |
v -d sdl_no_compile_flags ~/.vmodules/shy/examples/hello_world | |
ubuntu-latest-shy-can-live-anywhere: | |
runs-on: ubuntu-20.04 # use 20.04 for now | |
timeout-minutes: 10 | |
env: | |
VFLAGS: -cc tcc -no-retry-compilation | |
SDL2_VERSION: 2.0.8 | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev | |
curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz -o SDL2.tar.gz | |
tar -zxvf SDL2.tar.gz | |
- name: Build SDL | |
run: | | |
cd SDL2-${SDL2_VERSION} | |
mkdir build | |
cd build | |
../configure --prefix /tmp/sdl2-${SDL2_VERSION} | |
make | |
make install | |
- name: Checkout V | |
uses: actions/checkout@v2 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make -j4 && sudo ./v symlink | |
- name: Install sdl module | |
run: v install sdl | |
- name: Checkout shy | |
uses: actions/checkout@v2 | |
with: | |
path: shy | |
- name: Simulate "v install shy" | |
run: mv shy ~/.vmodules | |
- name: Run tests | |
run: v test ~/.vmodules/shy | |
- name: Build shy | |
run: v -g ~/.vmodules/shy | |
- name: Move shy | |
run: | | |
sudo mv ~/.vmodules/shy/shy /usr/bin/shy | |
- name: Run 'shy --help' | |
run: /usr/bin/shy --help | |
- name: Run 'shy doctor' | |
run: /usr/bin/shy doctor | |
- name: Build shy example | |
run: | | |
export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags)" | |
export LDFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --libs)" | |
v -d sdl_no_compile_flags ~/.vmodules/shy/examples/hello_world | |
ubuntu-latest-build: | |
runs-on: ubuntu-20.04 # use 20.04 for now (SDL2 compile issue) | |
timeout-minutes: 20 | |
env: | |
VFLAGS: -cc tcc -no-retry-compilation | |
SDL2_VERSION: 2.0.10 | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev | |
curl -L https://www.libsdl.org/release/SDL2-${SDL2_VERSION}.tar.gz -o SDL2.tar.gz | |
tar -zxvf SDL2.tar.gz | |
- name: Build SDL | |
run: | | |
cd SDL2-${SDL2_VERSION} | |
mkdir build | |
cd build | |
../configure --prefix /tmp/sdl2-${SDL2_VERSION} | |
make | |
make install | |
- name: Checkout V | |
uses: actions/checkout@v2 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make -j4 && sudo ./v symlink | |
- name: Install sdl module | |
run: v install sdl | |
- name: Checkout shy | |
uses: actions/checkout@v2 | |
with: | |
path: shy | |
- name: Simulate "v install shy" | |
run: mv shy ~/.vmodules | |
- name: Build shy | |
run: v -g ~/.vmodules/shy | |
- name: Symlink shy | |
run: sudo ln -s ~/.vmodules/shy/shy /usr/local/bin/shy | |
- name: Run 'shy --help' | |
run: shy --help | |
- name: Run 'shy doctor' | |
run: shy doctor | |
- name: Build shy examples | |
run: | | |
export CFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --cflags)" | |
export LDFLAGS="$(/tmp/sdl2-${SDL2_VERSION}/bin/sdl2-config --libs)" | |
declare -a shy_examples=('particles/simple.v' 'anchors/anchors.v' 'anchors/triangle_anchors.v' 'hello_world' 'image' 'shapes/circle' 'shapes/lines' 'shapes/rectangle' 'shapes/triangle' 'shapes/uniform_polygon' 'mouse' 'multi_window' 'sound/sound.v' 'sound/embedded_sound.v' 'timers') | |
echo "Compiling shy examples ${shy_examples[@]}" | |
for example in "${shy_examples[@]}"; do | |
v -skip-unused -d sdl_no_compile_flags ~/.vmodules/shy/examples/$example | |
done | |
echo "Compiling shy examples with "-d shy_analyse" ${shy_examples[@]}" | |
for example in "${shy_examples[@]}"; do | |
v -d sdl_no_compile_flags -d shy_analyse ~/.vmodules/shy/examples/$example | |
done | |
echo "Compiling shy examples with "-d shy_vet" ${shy_examples[@]}" | |
for example in "${shy_examples[@]}"; do | |
v -d sdl_no_compile_flags -d shy_vet ~/.vmodules/shy/examples/$example | |
done | |
sdl-branch-versions: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] # use 20.04 for now (SDL2 compile issue) | |
sdl-version: [2.0.9, 2.0.10, 2.0.12, 2.0.14, 2.0.16, 2.0.18, 2.0.20, 2.0.22, 2.24.0] | |
timeout-minutes: 20 | |
env: | |
VFLAGS: -cc tcc -no-retry-compilation | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev | |
curl -L https://www.libsdl.org/release/SDL2-${{ matrix.sdl-version }}.tar.gz -o SDL2.tar.gz | |
tar -zxvf SDL2.tar.gz | |
- name: Build SDL | |
run: | | |
cd SDL2-${{ matrix.sdl-version }} | |
mkdir build | |
cd build | |
../configure --prefix /tmp/sdl2-${{ matrix.sdl-version }} | |
make | |
make install | |
- name: Checkout V | |
uses: actions/checkout@v2 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make -j4 && sudo ./v symlink | |
- name: Checkout SDL ${{ matrix.sdl-version }} | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ matrix.sdl-version }} | |
repository: vlang/sdl | |
path: sdl | |
- name: Simulate "v install sdl" | |
run: | | |
mkdir -p ~/.vmodules | |
mv sdl ~/.vmodules | |
- name: Checkout shy | |
uses: actions/checkout@v2 | |
with: | |
path: shy | |
- name: Simulate "v install shy" | |
run: mv shy ~/.vmodules | |
- name: Build shy | |
run: v -g ~/.vmodules/shy | |
- name: Symlink shy | |
run: sudo ln -s ~/.vmodules/shy/shy /usr/local/bin/shy | |
- name: Run 'shy --help' | |
run: shy --help | |
- name: Run 'shy doctor' | |
run: shy doctor | |
- name: Build shy examples | |
run: | | |
export CFLAGS="$(/tmp/sdl2-${{ matrix.sdl-version }}/bin/sdl2-config --cflags)" | |
export LDFLAGS="$(/tmp/sdl2-${{ matrix.sdl-version }}/bin/sdl2-config --libs)" | |
declare -a shy_examples=('particles/simple.v' 'anchors/anchors.v' 'anchors/triangle_anchors.v' 'hello_world' 'image' 'shapes/circle' 'shapes/lines' 'shapes/rectangle' 'shapes/triangle' 'shapes/uniform_polygon' 'mouse' 'multi_window' 'sound/sound.v' 'sound/embedded_sound.v' 'timers') | |
echo "Compiling shy examples ${shy_examples[@]}" | |
for example in "${shy_examples[@]}"; do | |
v -skip-unused -d sdl_no_compile_flags ~/.vmodules/shy/examples/$example | |
done |