Skip to content

Commit de19048

Browse files
Merge pull request #69 from BuilderIO/chore/add-testing-pipeline
chore(cicd): setup test pipeline
2 parents b802560 + f1588af commit de19048

File tree

7 files changed

+1580
-9822
lines changed

7 files changed

+1580
-9822
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/pr.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Pull request workflow
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, edited]
6+
7+
permissions:
8+
pull-requests: read
9+
10+
jobs:
11+
build:
12+
name: Build and test
13+
runs-on: ubuntu-latest
14+
env:
15+
CI_JOB_NUMBER: 1
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v2
19+
with:
20+
cache: npm
21+
node-version: 18
22+
- run: npm i
23+
- run: npm run build
24+
- run: npm run test
25+
- uses: preactjs/compressed-size-action@v2
26+
with:
27+
pattern: ".dist/**/*.{js,ts,json}"
28+
static-tests:
29+
name: Static tests
30+
runs-on: ubuntu-latest
31+
needs: build
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: actions/setup-node@v2
35+
with:
36+
cache: npm
37+
node-version: 18
38+
- run: npm i
39+
- run: npm run prettier:check
40+
build-docker:
41+
name: Build Docker image
42+
runs-on: ubuntu-latest
43+
needs: build
44+
steps:
45+
- uses: actions/checkout@v2
46+
- uses: docker/build-push-action@v2
47+
with:
48+
context: .
49+
file: ./Dockerfile
50+
push: false
51+
semantic-pr:
52+
name: Validate PR title for semantic versioning
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: amannn/action-semantic-pull-request@v5
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run fmt

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ FROM apify/actor-node-playwright-chrome:18 AS builder
77
# to speed up the build using Docker layer cache.
88
COPY --chown=myuser package*.json ./
99

10+
# Delete the prepare script. It's not needed in the final image.
11+
RUN npm pkg delete scripts.prepare
12+
1013
# Install all dependencies. Don't audit to speed up the installation.
1114
RUN npm install --include=dev --audit=false
1215

@@ -31,7 +34,8 @@ COPY --chown=myuser package*.json ./
3134
# Install NPM packages, skip optional and development dependencies to
3235
# keep the image small. Avoid logging too much and print the dependency
3336
# tree for debugging
34-
RUN npm --quiet set progress=false \
37+
RUN npm pkg delete scripts.prepare \
38+
&& npm --quiet set progress=false \
3539
&& npm install --omit=dev --omit=optional \
3640
&& echo "Installed NPM packages:" \
3741
&& (npm list --omit=dev --all || true) \

0 commit comments

Comments
 (0)