From 35928c88272fd65beba5e510c1bdc859cc560363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Chalk?= Date: Mon, 28 Aug 2023 08:59:55 +0200 Subject: [PATCH 1/3] chore: create CI workflow --- .github/workflows/ci.yml | 98 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..05e0a68dc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,98 @@ +name: CI + +on: push + +jobs: + audit: + runs-on: ubuntu-latest + name: Audit + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - name: Audit production dependencies + run: npm audit --omit=dev --omit=optional + + format: + runs-on: ubuntu-latest + name: Format check + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v3 + - name: Install dependencies + run: npm ci + - name: Check formatting of affected files + run: npx nx format:check + + lint: + runs-on: ubuntu-latest + name: Linter + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v3 + - name: Install dependencies + run: npm ci + - name: Lint affected projects + run: npx nx affected:lint --parallel=3 --max-warnings=0 + + test: + runs-on: ubuntu-latest + name: Unit tests + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v3 + - name: Install dependencies + run: npm ci + - name: Test affected projects + run: npx nx affected:test --parallel=3 --configuration=ci + + build: + runs-on: ubuntu-latest + name: Build + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v3 + - name: Install dependencies + run: npm ci + - name: Build affected projects + run: npx nx affected:build --parallel=3 From 1a54887c802dfef85106f930c4853c0f6c5c6201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Chalk?= Date: Mon, 28 Aug 2023 09:09:00 +0200 Subject: [PATCH 2/3] fix: sync package-lock.json with `npm install` --- package-lock.json | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index d49a1eeff..f8a140700 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2427,6 +2427,13 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, + "node_modules/@types/node": { + "version": "20.5.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.7.tgz", + "integrity": "sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA==", + "dev": true, + "peer": true + }, "node_modules/@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", @@ -5334,7 +5341,8 @@ "version": "7.21.0-placeholder-for-preset-env.2", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", - "dev": true + "dev": true, + "requires": {} }, "@babel/plugin-syntax-async-generators": { "version": "7.8.4", @@ -6529,6 +6537,13 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "dev": true }, + "@types/node": { + "version": "20.5.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.7.tgz", + "integrity": "sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA==", + "dev": true, + "peer": true + }, "@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", From df739ebf6bd5663b08d9c4a5261ed69451576747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Chalk?= Date: Mon, 28 Aug 2023 09:14:05 +0200 Subject: [PATCH 3/3] chore: add e2e target to CI workflow --- .github/workflows/ci.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05e0a68dc..28383ab44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,27 @@ jobs: - name: Install dependencies run: npm ci - name: Test affected projects - run: npx nx affected:test --parallel=3 --configuration=ci + run: npx nx affected:test --parallel=3 + + e2e: + runs-on: ubuntu-latest + name: E2E tests + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - name: Set base and head for Nx affected commands + uses: nrwl/nx-set-shas@v3 + - name: Install dependencies + run: npm ci + - name: Test affected projects + run: npx nx affected:e2e --parallel=3 build: runs-on: ubuntu-latest