Stable animation system #99
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: New changes validation | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
jobs: | |
cache-V: | |
runs-on: ubuntu-latest | |
steps: | |
# Because of problems with `setup-v` action, when Vlang version is specified, and also because of V evolving continuously, | |
# and you need the latest commit of V most of the time, we always use the latest V version from the master branch | |
# and getting it from the cache on the start of a job is not possible (because you need to know a version of V to cache it). | |
# This step should be uncommented when Vlang will be stable and caching will be possible. | |
# - name: Check if V is cached | |
# id: check-v-cache | |
# uses: actions/cache/restore@v3 | |
# with: | |
# path: vlang | |
# key: vlang-0.3.3-weekly.2023.08 | |
- name: Install V | |
id: install-v | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Set V_VERSION environment variable | |
run: echo "V_VERSION=$(v -v)" >> $GITHUB_ENV | |
- name: Cache Vlang | |
uses: actions/cache/save@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
simple-build: | |
needs: cache-V | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
trimming: [ '', -skip-unused ] | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: ${{ matrix.trimming }} build | |
run: v ${{ matrix.trimming }} . | |
tests: | |
needs: simple-build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: Run tests | |
run: v test . | |
different-compilers: | |
needs: tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
compiler: [ gcc, clang ] | |
trimming: [ '', -skip-unused ] | |
optimization: [ '', -prod ] | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: ${{ matrix.compiler }} ${{ matrix.trimming }} ${{ matrix.optimization }} build | |
run: v -cc ${{ matrix.compiler }} ${{ matrix.trimming }} ${{ matrix.optimization }} . | |
clang-sanitizers: | |
needs: different-compilers | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
sanitizer: [ address, memory, undefined, leak ] # TODO: thread sanitizer was removed due to strange warnings. It should be fixed and turned on. | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: Clang ${{ matrix.sanitizer }} sanitizer | |
run: v -cc clang -cflags -fsanitize=${{ matrix.sanitizer }} test . | |
gcc-sanitizers: | |
needs: different-compilers | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
sanitizer: [ leak ] # TODO: thread sanitizer was removed due to strange warnings. It should be fixed and turned on. | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: GCC ${{ matrix.sanitizer }} sanitizer | |
run: v -cc gcc -cflags -fsanitize=${{ matrix.sanitizer }} test . | |
gcc-address-sanitizers: | |
needs: different-compilers | |
runs-on: ubuntu-latest | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: GCC address sanitizer | |
run: v -cc gcc -cflags -fsanitize=address -cflags -fsanitize-address-use-after-scope -cflags -fsanitize=pointer-compare -cflags -fsanitize=pointer-subtract test . | |
gcc-undefined-sanitizers: | |
needs: different-compilers | |
runs-on: ubuntu-latest | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: GCC undefined sanitizer | |
run: v -cc gcc -cflags -fsanitize=undefined -cflags -fsanitize=shift -cflags -fsanitize=shift-exponent -cflags -fsanitize=shift-base -cflags -fsanitize=integer-divide-by-zero -cflags -fsanitize=unreachable -cflags -fsanitize=vla-bound -cflags -fsanitize=null -cflags -fsanitize=return -cflags -fsanitize=signed-integer-overflow -cflags -fsanitize=bounds -cflags -fsanitize=bounds-strict -cflags -fsanitize=alignment -cflags -fsanitize=object-size -cflags -fsanitize=float-divide-by-zero -cflags -fsanitize=float-cast-overflow -cflags -fsanitize=nonnull-attribute -cflags -fsanitize=returns-nonnull-attribute -cflags -fsanitize=bool -cflags -fsanitize=enum -cflags -fsanitize=vptr -cflags -fsanitize=pointer-overflow -cflags -fsanitize=builtin test . | |
vab-compilation: | |
needs: [ clang-sanitizers, gcc-sanitizers, gcc-address-sanitizers, gcc-undefined-sanitizers ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: 17 | |
- name: Setup Android SDK | |
uses: amyu/setup-android@v2 | |
with: | |
sdk-version: 31 | |
build-tools-version: '33.0.2' | |
ndk-version: '25.2.9519653' | |
cache-disabled: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: Install vab | |
run: | | |
v install vab | |
v -g ~/.vmodules/vab | |
sudo ln -s ~/.vmodules/vab/vab /usr/local/bin/vab | |
- name: Build APK | |
run: vab --min-sdk-version 28 --api 31 --gles 3 --archs 'arm64-v8a' -v 3 --flag '-skip-unused' . | |
check-formatting: | |
needs: vab-compilation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: Check formatting | |
run: v fmt -verify . | |
check-docs: | |
needs: vab-compilation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: Check markdown line length & code examples | |
run: v check-md -hide-warnings . | |
- name: Check public methods without documentation | |
run: v missdoc --exclude src/tests/ --verify . | |
vet-check: | |
needs: vab-compilation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Restore Vlang | |
uses: actions/cache/restore@v3 | |
with: | |
path: vlang | |
key: ${{ runner.os }}-vlang-${{ env.V_VERSION }} | |
fail-on-cache-miss: true | |
- name: Install V | |
uses: vlang/[email protected] | |
with: | |
check-latest: true | |
- name: Install graphic libs dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --quiet -y libxi-dev libxcursor-dev libgl-dev | |
- name: Checkout ${{ github.event.repository.name }} | |
uses: actions/checkout@v3 | |
- name: Install project dependencies | |
run: v install | |
- name: Check code with vet | |
run: v vet -W . |