diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-full.yml similarity index 98% rename from .github/workflows/e2e-tests.yml rename to .github/workflows/e2e-full.yml index f4db1a211b..85b7cb5516 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-full.yml @@ -1,4 +1,4 @@ -name: Run e2e tests +name: E2E on: push: branches: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000000..69ff86c68d --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,42 @@ +name: E2E +on: + pull_request: + branches: + - main +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + db: ['postgres'] + node-version: ['16-alpine'] + env: + CACHED_IMAGE: ghcr.io/directus/directus-e2e-test-cache:${{ matrix.node-version }} + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.9.0 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '16' + - name: restore node_modules cache + uses: actions/cache@v2 + with: + path: | + node_modules + **/node_modules + key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} + - name: Install dependencies + run: | + npm install + - name: Build + run: | + npm run build + - name: Run tests + env: + TEST_NODE_VERSION: ${{ matrix.node-version }} + TEST_DB: ${{ matrix.db }} + run: npm run test:e2e diff --git a/Dockerfile b/Dockerfile index 1c12ca1d99..4e488976fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,32 +26,12 @@ FROM node:${NODE_VERSION} #ENV TNS_ADMIN /usr/lib/instantclient #ENV ORACLE_HOME /usr/lib/instantclient -RUN npm i -g lerna - WORKDIR /directus -COPY package*.json ./ -COPY lerna.json ./ -COPY api/package.json api/ -COPY api/cli.js api/ -COPY app/package.json app/ -COPY docs/package.json docs/ -COPY packages/create-directus-project/package.json packages/create-directus-project/ -COPY packages/create-directus-project/lib/index.js packages/create-directus-project/lib/ -COPY packages/drive/package.json packages/drive/ -COPY packages/drive-azure/package.json packages/drive-azure/ -COPY packages/drive-gcs/package.json packages/drive-gcs/ -COPY packages/drive-s3/package.json packages/drive-s3/ -COPY packages/format-title/package.json packages/format-title/ -COPY packages/gatsby-source-directus/package.json packages/gatsby-source-directus/ -COPY packages/schema/package.json packages/schema/ -COPY packages/sdk/package.json packages/sdk/ -COPY packages/specs/package.json packages/specs/ - -RUN npx lerna bootstrap - COPY . . +RUN npm install + WORKDIR /directus/api CMD ["sh", "-c", "node ./dist/cli/index.js bootstrap; node ./dist/start.js;"]