ci: add testing workflow #11
This file contains hidden or 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: Run tests | |
on: [push, pull_request] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup repository | |
uses: actions/checkout@v4 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'npm' | |
- name: Setup environment | |
run: | | |
sudo apt-get install -y build-essential wget | |
npm install --save-dev | |
- name: Build extension | |
run: npm run compile | |
- name: Install databases | |
run: | | |
./src/test/setup.sh -j 4 --pg-version=17 | |
./src/test/setup.sh -j 4 --pg-version=16 | |
./src/test/setup.sh -j 4 --pg-version=15 | |
./src/test/setup.sh -j 4 --pg-version=14 | |
./src/test/setup.sh -j 4 --pg-version=13 | |
./src/test/setup.sh -j 4 --pg-version=12 | |
./src/test/setup.sh -j 4 --pg-version=11 | |
./src/test/setup.sh -j 4 --pg-version=10 | |
./src/test/setup.sh -j 4 --pg-version=9.6 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: prepared-env | |
path: | | |
pgsrc | |
node_modules | |
out | |
test: | |
needs: setup | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
pgversion: ['17', '16'] | |
vscodeversion: ['stable'] | |
debugger: ['cppdbg', 'lldb'] | |
steps: | |
- name: Setup repository | |
uses: actions/checkout@v4 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'npm' | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
- name: Run test | |
run: ./src/test/test.sh -j 4 --no-gui \ | |
--pg-versions="${{ matrix.pgversion }}" \ | |
--vscode-versions="${{ matrix.vscodeversion }}" \ | |
--debuggers="${{ matrix.debugger }}" | |