-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 2.19 KB
/
build.yml
File metadata and controls
68 lines (60 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Commerce Build
on:
workflow_dispatch:
inputs:
branch:
description: Branch name to re-build ?
required: true
type: string
push:
jobs:
build:
env:
branch: ${{ inputs.branch || github.ref_name }}
stage: ${{ inputs.branch == 'main' && 'latest' || github.ref_name == 'main' && 'latest' || 'next' }}
runs-on: ubuntu-latest
strategy:
matrix:
browser: [chromium, chrome]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.branch }}
token: ${{secrets.DONTCODE_ACTIONS_TOKEN}}
- name: Use Node.js version 18
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
- name: Install
run: |
npm install -g nx
npm install --force
npm install @dontcode/core@${{env.stage}} @dontcode/plugin-common@${{env.stage}} @dontcode/sandbox@${{env.stage}} @dontcode/plugin-basic@${{env.stage}} @dontcode/plugin-fields@${{env.stage}}
npm explain @dontcode/core
npm explain @dontcode/plugin-common
- name: Build
run: |
nx run commerce:build:production
- name: Unit Tests
run: |
nx run commerce:test
nx run commerce-tester:test
- name: E2E Tests on ${{matrix.browser}}
run: |
nx run commerce-tester-e2e:e2e --browser ${{matrix.browser}}
- uses: actions/upload-artifact@v4
# Test run screenshots only on failure
if: failure()
with:
name: cypress-${{matrix.browser}}-screenshots
path: dist/cypress/apps/commerce-tester-e2e/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-${{matrix.browser}}-videos
path: dist/cypress/apps/commerce-tester-e2e/videos