build: Vlang 0.4.3 compatibility updates #49
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 | |
on: [push, pull_request] | |
jobs: | |
test-ubuntu-macos: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
include: | |
- os: ubuntu-latest | |
install-lib: sudo apt-get install --quiet -y libpcre2-dev | |
- os: macos-latest | |
install-lib: brew install pcre2 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Latest V | |
uses: actions/checkout@v3 | |
with: | |
repository: vlang/v | |
path: v | |
- name: Build V | |
run: | | |
cd v && make && sudo ./v symlink && cd - | |
- name: Install pcre2 library dependency | |
run: | | |
${{ matrix.install-lib }} | |
- name: Install pcre2 module | |
run: | | |
v install srackham.pcre2 | |
- name: Run tests | |
run: | | |
v -cstrict test $HOME/.vmodules/srackham/pcre2 | |
- name: Run examples | |
run: | | |
v -cstrict run $HOME/.vmodules/srackham/pcre2/examples/pcre2-example-1.v | |
- name: Build example with -prod | |
# Can't use -cstrict (see https://github.com/vlang/v/issues/16016) | |
run: v -cc gcc -prod $HOME/.vmodules/srackham/pcre2/examples/pcre2-example-1.v | |
test-windows: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- name: Checkout Latest V | |
uses: actions/checkout@v3 | |
with: | |
repository: vlang/v | |
path: v | |
- name: Build V | |
run: | | |
cd v | |
.\make.bat | |
.\v.exe symlink | |
- name: Setup MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
update: true | |
- name: Install MYSYS2 package mingw-w64-x86_64-pcre2 | |
run: | | |
C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-pcre2 | |
- name: Install V module pcre2 | |
run: | | |
.\v\v.exe install srackham.pcre2 | |
- name: Run tests | |
run: | | |
.\v\v.exe test %USERPROFILE%\.vmodules\srackham\pcre2 | |
- name: Run examples | |
run: | | |
.\v\v.exe run %USERPROFILE%/.vmodules/srackham/pcre2/examples/pcre2-example-1.v |