-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (93 loc) · 3.58 KB
/
develop.yml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Install CLI @develop
on:
# push:
# branches: [ main ]
pull_request:
branches:
- "main"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/Hydrogen
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Ensure there is no .nprmc with tokens
run: cat ~/.npmrc
- name: Ensure there is no .nprmc with tokens
run: rm ~/.npmrc
- name: Ensure there is no .nprmc with tokens
uses: GuillaumeFalourd/[email protected]
with:
command_line: rm ~/.npmrc && cat ~/.npmrc
assert_file_path: discard.txt
expected_result: PASSED
- name: Install Supernova CLI dependency
run: npm install --g @supernovaio/cli
- name: Check Supernova version
run: supernova --version
- name: Describe design system
run: >
supernova describe-design-system
--apiKey="${{ secrets.SN_API_KEY_DEV }}"
--designSystemId="3644"
--environment=development
- name: Describe workspaces
run: >
supernova describe-workspaces
--apiKey="${{ secrets.SN_API_KEY_DEV }}"
--environment=development
- name: Publish documentation
run: >
supernova publish-documentation
--apiKey="${{ secrets.SN_API_KEY_DEV }}"
--designSystemId="3644"
--environment=development
- name: Synchronize tokens with Supernova
run: >
supernova sync-tokens
--apiKey="${{ secrets.SN_API_KEY_DEV }}"
--designSystemId="3644"
--tokenFilePath="${{ github.workspace }}/test-resources/figma-tokens/single-file-sync/tokens.json"
--configFilePath="${{ github.workspace }}/test-resources/figma-tokens/single-file-sync/supernova.settings.json"
--environment=development
- name: Build local exporter
run: cd ${{ github.workspace }}/test-resources/exporter && npm i && npm run build
- name: Run local exporter with Supernova
run: >
supernova run-local-exporter
--apiKey="${{ secrets.SN_API_KEY_DEV }}"
--designSystemId="3644"
--brandId="acf822d2-c315-4897-b875-d5b00654b057"
--exporterDir="${{ github.workspace }}/test-resources/exporter"
--outputDir="${{ github.workspace }}/test-resources/exporter-output"
--allowOverridingOutput
--environment=development
- name: Archive exporter artifacts
uses: actions/upload-artifact@v3
with:
name: exporter-output
path: ${{ github.workspace }}/test-resources/exporter-output
retention-days: 5
- name: Assert list of exported files
uses: GuillaumeFalourd/[email protected]
with:
command_line: ls -R ${{ github.workspace }}/test-resources/exporter-output | grep .css
assert_file_path: ${{ github.workspace }}/test-resources/exporter-output-files.txt
expected_result: PASSED