export: split AppImage and Android functionality out to own .v files #324
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@v4 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make -j4 && sudo ./v symlink | |
- name: Checkout shy | |
uses: actions/checkout@v4 | |
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 | |
timeout-minutes: 20 | |
env: | |
VFLAGS: -cc tcc -no-retry-compilation | |
SDL2_VERSION: 2.0.9 | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet 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 --disable-wayland-shared | |
make | |
sudo make install | |
- name: Checkout V | |
uses: actions/checkout@v4 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make -j4 && sudo ./v symlink | |
- name: Install vlang/sdl @ ${{ env.SDL2_VERSION }} | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.SDL2_VERSION }} | |
repository: vlang/sdl | |
path: sdl | |
- name: Simulate "v install sdl" | |
run: | | |
mkdir -p ~/.vmodules | |
mv sdl ~/.vmodules | |
- name: Checkout shy | |
uses: actions/checkout@v4 | |
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: | | |
v ~/.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.9 | |
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 --disable-wayland-shared | |
make | |
sudo make install | |
- name: Checkout V | |
uses: actions/checkout@v4 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make && sudo ./v symlink | |
- name: Install vlang/sdl @ ${{ env.SDL2_VERSION }} | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.SDL2_VERSION }} | |
repository: vlang/sdl | |
path: sdl | |
- name: Simulate "v install sdl" | |
run: | | |
mkdir -p ~/.vmodules | |
mv sdl ~/.vmodules | |
- name: Checkout shy | |
uses: actions/checkout@v4 | |
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: | | |
v ~/.vmodules/shy/examples/hello_world | |
ubuntu-latest-build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
env: | |
VFLAGS: -cc tcc -no-retry-compilation | |
SDL2_VERSION: 2.0.9 | |
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 --disable-wayland-shared | |
make | |
sudo make install | |
- name: Checkout V | |
uses: actions/checkout@v4 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make && sudo ./v symlink | |
- name: Install vlang/sdl @ ${{ env.SDL2_VERSION }} | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.SDL2_VERSION }} | |
repository: vlang/sdl | |
path: sdl | |
- name: Simulate "v install sdl" | |
run: | | |
mkdir -p ~/.vmodules | |
mv sdl ~/.vmodules | |
- name: Checkout shy | |
uses: actions/checkout@v4 | |
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: | | |
v -skip-unused should-compile-all ~/.vmodules/shy/examples | |
v -d shy_analyse should-compile-all ~/.vmodules/shy/examples | |
v -d shy_vet should-compile-all ~/.vmodules/shy/examples | |
sdl-branch-versions: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
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, 2.26.0, 2.28.0, 2.30.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 mesa-common-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 | |
make | |
sudo make install | |
- name: Checkout V | |
uses: actions/checkout@v4 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make && sudo ./v symlink | |
- name: Checkout SDL ${{ matrix.sdl-version }} | |
uses: actions/checkout@v4 | |
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@v4 | |
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: | | |
v -d sdl_no_compile_flags -skip-unused should-compile-all ~/.vmodules/shy/examples | |
v -d sdl_no_compile_flags -d shy_analyse should-compile-all ~/.vmodules/shy/examples | |
v -d sdl_no_compile_flags -d shy_vet should-compile-all ~/.vmodules/shy/examples | |
sdl-d-gamepad-branch-versions: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
sdl-version: [2.26.0, 2.28.0, 2.30.0] # Gamepad support requires SDL2 >= 2.26.0 | |
timeout-minutes: 20 | |
env: | |
VFLAGS: -cc tcc -no-retry-compilation -d shy_gamepad | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y mesa-common-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 | |
make | |
sudo make install | |
- name: Checkout V | |
uses: actions/checkout@v4 | |
with: | |
repository: vlang/v | |
- name: Build local v | |
run: make && sudo ./v symlink | |
- name: Checkout SDL ${{ matrix.sdl-version }} | |
uses: actions/checkout@v4 | |
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@v4 | |
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: | | |
v -d sdl_no_compile_flags -skip-unused should-compile-all ~/.vmodules/shy/examples | |
v -d sdl_no_compile_flags -d shy_analyse should-compile-all ~/.vmodules/shy/examples | |
v -d sdl_no_compile_flags -d shy_vet should-compile-all ~/.vmodules/shy/examples |