-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add action for develop environment
- Loading branch information
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: CI @ develop environment | ||
|
||
on: | ||
# push: | ||
# branches: [ main ] | ||
pull_request: | ||
branches: | ||
- "main" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- 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: Install Supernova CLI dependency | ||
run: npm install --g @supernovaio/cli | ||
|
||
- name: Check Supernova version | ||
run: supernova --version | ||
|
||
- 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" | ||
- 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 | ||
- 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 |