ci: add sdl workflow for testing `vlang/sdl` (#12934)

pull/12938/head
Larpon 2021-12-22 16:52:47 +01:00 committed by GitHub
parent 278c08704c
commit b3161b05a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 43 additions and 0 deletions

43
.github/workflows/sdl_ci.yml vendored 100644
View File

@ -0,0 +1,43 @@
name: sdl CI
on:
push:
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
jobs:
v-compiles-sdl-examples:
runs-on: ubuntu-18.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Build V
run: make -j2 && ./v -cc gcc -o v cmd/v
- name: Clone sdl into .vmodules
run: |
git clone --depth 1 https://github.com/vlang/sdl
cd sdl
mkdir -p ~/.vmodules
ln -s $(pwd) ~/.vmodules/sdl
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --quiet -y libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev
- name: Run tests
run: ./v test sdl
- name: Build sdl shared
run: ./v -shared -g sdl
- name: Build sdl examples
run: |
declare -a v_sdl_examples=('basic_window' 'tvintris')
for example in "${v_sdl_examples[@]}"; do
./v sdl/examples/$example
done