ci: update GitHub Actions

This commit is contained in:
Catalin Pit
2023-09-30 10:52:58 +01:00
parent 5f27eb20fd
commit a18932378f
2 changed files with 17 additions and 18 deletions

View File

@@ -1,15 +0,0 @@
# .github/actions/docker-compose/action.yml
name: 'Docker-Compose Setup'
description: 'Sets up docker-compose'
runs:
using: 'composite'
steps:
- name: Download Docker-Compose plugin
shell: bash
run: |
mkdir -p ${{ runner.temp }}/bin
curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o ${{ runner.temp }}/bin/docker-compose
echo "${{ runner.temp }}/bin" >> $GITHUB_PATH
- name: Make plugin executable
shell: bash
run: chmod +x ${{ runner.temp }}/bin/docker-compose

View File

@@ -8,12 +8,26 @@ jobs:
e2e_tests:
timeout-minutes: 60
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/documenso
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: ./.github/workflows/actions/docker-compose
- name: Generate package-lock.json
run: npm install
- name: Install dependencies
@@ -24,6 +38,8 @@ jobs:
run: npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Create the database
run: npx prisma migrate deploy
- name: Run Playwright tests
run: npm run ci
- uses: actions/upload-artifact@v3
@@ -32,5 +48,3 @@ jobs:
name: playwright-report
path: playwright-report/
retention-days: 30
env:
DATABASE_URL: postgres://myuser:documenso@localhost:5432/postgres