-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (66 loc) · 2.24 KB
/
build-screen.yml
File metadata and controls
73 lines (66 loc) · 2.24 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
69
70
71
72
73
# 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: Screen Build
on:
workflow_dispatch:
inputs:
branch:
description: Branch name to re-build ?
required: true
type: string
push:
paths:
- '*'
- 'libs/screen/**'
- '.github/workflows/build-screen.yml'
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:
repository: dont-code/plugins
path: plugins
fetch-depth: 0
ref: ${{ env.branch }}
token: ${{secrets.DONTCODE_ACTIONS_TOKEN}}
- name: Setup build environment
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: plugins/package-lock.json
- name: Install
run: |
npm install -g nx
npm ci
npm install @dontcode/core@${{env.stage}} --no-optional
working-directory: 'plugins'
- name: Build
run: |
nx run screen:build:production
working-directory: 'plugins'
- name: Tests
run: |
nx run screen:test
nx run plugin-tester-e2e:e2e --browser ${{matrix.browser}}
working-directory: 'plugins'
- uses: actions/upload-artifact@v4
# Test run screenshots only on failure
if: failure()
with:
name: cypress-${{matrix.browser}}-screenshots
path: plugins/dist/cypress/apps/plugin-tester-e2e/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-${{matrix.browser}}-videos
path: plugins/dist/cypress/apps/plugin-tester-e2e/videos