ubuntu + browser + NodeJS + postgres #51
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: Compatibility testing | |
| run-name: ubuntu + browser + NodeJS + postgres | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| compatibility-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node: [14, 18, 20] | |
| browser: [chrome, firefox, edge] | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: wikijs | |
| POSTGRES_PASSWORD: wikijsrocks | |
| POSTGRES_DB: wiki | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U wikijs -d wiki" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| path: mainrepo | |
| - name: Checkout Wiki.js source | |
| run: | | |
| wget https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz | |
| mkdir wikijs | |
| tar xzf wiki-js.tar.gz -C ./wikijs | |
| cd wikijs | |
| mv config.sample.yml config.yml | |
| - name: Setup Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Install dependencies | |
| run: | | |
| cd wikijs | |
| npm install --no-audit --no-fund --legacy-peer-deps | |
| - name: Set Database ENV | |
| run: | | |
| echo "DB_TYPE=postgres" >> $GITHUB_ENV | |
| echo "DB_HOST=localhost" >> $GITHUB_ENV | |
| echo "DB_PORT=5432" >> $GITHUB_ENV | |
| echo "DB_USER=wikijs" >> $GITHUB_ENV | |
| echo "DB_PASS=wikijsrocks" >> $GITHUB_ENV | |
| echo "DB_NAME=wiki" >> $GITHUB_ENV | |
| - name: Build Wiki.js | |
| run: | | |
| cd wikijs | |
| echo "Running build on Node ${{ matrix.node }} and Browser ${{ matrix.browser }}" | |
| npm rebuild sqlite3 | |
| - name: Start Wiki.js server | |
| run: | | |
| cd wikijs | |
| nohup node server > server.log 2>&1 & | |
| sleep 20 | |
| cat server.log | |
| - name: Test server response | |
| run: | | |
| curl -I http://localhost:3000 || (cat wikijs/server.log && exit 1) | |
| - name: Install Playwright | |
| run: | | |
| npm install -D @playwright/test | |
| npx playwright install --with-deps | |
| - name: Run Playwright Tests | |
| working-directory: mainrepo | |
| run: | | |
| npx playwright test --config=playwright.config.ts --project=${{ matrix.browser }} |