fix: typo in '-o pipefail' #157
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: | |
schedule: | |
# At 13:00 each Friday | |
- cron: 0 13 * * 5 | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
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: Restore node_modules from cache | |
id: restore-node-modules | |
uses: actions/cache/restore@v4 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('package-lock.json') }} | |
- name: Install node_modules | |
if: steps.restore-node-modules.outputs.cache-hit != 'true' | |
run: | | |
npm i | |
npm i -D | |
- name: Store node_modules to cache | |
uses: actions/cache/save@v4 | |
if: steps.restore-node-modules.outputs.cache-hit != 'true' | |
with: | |
path: node_modules | |
key: ${{ steps.restore-node-modules.outputs.cache-primary-key }} | |
- name: Build extension | |
run: npm run compile | |
- name: Run linter | |
run: npm run lint | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
pgversion: ['18', '17', '16', '15', '14', '13', '12', '11', '10', '9.6'] | |
steps: | |
- name: Setup repository | |
uses: actions/checkout@v4 | |
- name: Restore node_modules | |
uses: actions/cache/restore@v4 | |
with: | |
path: node_modules | |
key: node_modules-${{ hashFiles('package-lock.json') }} | |
fail-on-cache-miss: true | |
- name: Build extension | |
run: npm run compile | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'npm' | |
- name: Setup environment | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential wget gdb lldb libpq5 | |
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope | |
- name: Restore PostgreSQL | |
id: restore-postgresql | |
uses: actions/cache/restore@v4 | |
with: | |
path: pgsrc/${{ matrix.pgversion }} | |
key: pgsql-src-${{ runner.os }}-${{ runner.arch }}-${{ matrix.pgversion }}-${{ hashFiles('src/test/patches/**') }} | |
- name: Build PostgreSQL | |
if: steps.restore-postgresql.outputs.cache-hit != 'true' | |
run: | | |
./src/test/setup.sh -j 4 --pg-version=${{ matrix.pgversion }} | |
- name: Save PostgreSQL build cache | |
uses: actions/cache/save@v4 | |
if: steps.restore-postgresql.outputs.cache-hit != 'true' | |
with: | |
path: pgsrc/${{ matrix.pgversion }} | |
key: ${{ steps.restore-postgresql.outputs.cache-primary-key }} | |
- name: Run tests | |
run: ./src/test/test.sh --no-gui --tests="all" --pg-versions=${{ matrix.pgversion }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: postgresql-logs-${{ matrix.pgversion }} | |
retention-days: 3 | |
path: | | |
pgsrc/${{ matrix.pgversion }}/data/postgresql.log | |
src/test/log | |
.vscode-test/user-data/logs/**/ash-blade.postgresql-hacker-helper/*.log |