From 7cca910ccee871087589a50c933d60d0d1a55557 Mon Sep 17 00:00:00 2001 From: Chris Wilkinson Date: Tue, 27 Jul 2021 13:52:11 +0100 Subject: [PATCH] ci(docker): separate testing and linting from the build Creates new CI steps to run the lint and test commands, rather than having them run inside the Docker build. This means that the image can be built even if there are linting issues (which will be useful for local development), and that the tests will be able to make use of other processes (and given the app has a reliance on React and Postgres, this is vital). Refs #388, #390 --- .github/workflows/deploy_prereview-dev.yml | 6 ++++++ Dockerfile | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy_prereview-dev.yml b/.github/workflows/deploy_prereview-dev.yml index d132be03..ddeb44d6 100644 --- a/.github/workflows/deploy_prereview-dev.yml +++ b/.github/workflows/deploy_prereview-dev.yml @@ -23,6 +23,12 @@ jobs: - name: 'Build dev image' run: docker-compose --file docker-compose.yml --file docker-compose.dev.yml build prereview + - name: 'Lint' + run: docker-compose --file docker-compose.yml --file docker-compose.dev.yml run --entrypoint "npm run" prereview lint + + - name: 'Test' + run: docker-compose --file docker-compose.yml --file docker-compose.dev.yml run --entrypoint "npm run" prereview test + - name: 'Login via Azure CLI' uses: azure/login@v1 with: diff --git a/Dockerfile b/Dockerfile index 3ea62747..219d65c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,9 +18,6 @@ RUN npm ci COPY . . -RUN npm run lint -RUN npm run test - ENV NODE_ENV=production # Avoid lscpu warning on Alpine