name: 'Continuous Integration' on: workflow_call: push: branches: ['main'] pull_request: branches: ['main'] concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: build_app: name: Build App runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 2 - uses: ./.github/actions/node-install - name: Copy env run: cp .env.example .env - name: Build app run: npm run build unit_tests: name: Unit Tests runs-on: ubuntu-latest timeout-minutes: 20 steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 2 - uses: ./.github/actions/node-install - name: Copy env run: cp .env.example .env # Includes the 2FA enforcement drift guard (packages/trpc), which is the # only check that catches a session route without enforcement middleware. - name: Run unit tests run: npm run test -w @documenso/lib -w @documenso/trpc build_docker: name: Build Docker Image runs-on: ubuntu-latest timeout-minutes: 60 steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build Docker Image uses: docker/build-push-action@v5 with: push: false context: . file: ./docker/Dockerfile tags: documenso-${{ github.sha }}