Skip to content

Commit

Permalink
IOS-10444 Mistica importer from GH Actions (#390)
Browse files Browse the repository at this point in the history
* Tests action for the tool

* Create a new workflow for mistica-skin-generator-tests and modify the generation flow to generate tokens

* Test show URL

* Clean up
  • Loading branch information
amegias authored Jul 31, 2024
1 parent 35f6847 commit c092de5
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 18 deletions.
50 changes: 32 additions & 18 deletions .github/workflows/generate-mistica-tokens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,39 @@ name: Generate Mistica Tokens
on:
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
get-design-tokens:
name: Get Design Tokens
runs-on: self-hosted-novum-mac
build:
name: Build & generate tokens
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Install dependencies
run: npm install
working-directory: scripts/mistica-skin-generator

- name: Generate Skin
run: make skin
- name: Generate tokens
run: npm run generate
working-directory: scripts/mistica-skin-generator

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.NOVUM_PRIVATE_REPOS }}
add-paths: 'Sources/MisticaCommon/*'
commit-message: 'feat(skin): update design tokens'
title: 'feat(skin): update design tokens from mistica-design'
branch: 'import-design-tokens'
team-reviewers: 'ios'
delete-branch: true
draft: true
- name: Create Pull Request
id: create_pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.NOVUM_PRIVATE_REPOS }}
add-paths: 'Sources/MisticaCommon/*'
commit-message: 'feat(skin): update design tokens'
title: 'feat(skin): update design tokens from mistica-design'
branch: 'import-design-tokens'
team-reviewers: 'ios'
delete-branch: true
- name: Show URL in summary annotation
run: echo '::notice::Pull Request generated ${{ steps.create_pr.outputs.pull-request-url }}'
30 changes: 30 additions & 0 deletions .github/workflows/mistica-skin-generator-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Mistica skin generator tests

on:
workflow_dispatch:
push:
paths:
- 'scripts/mistica-skin-generator/**'

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build & execute tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Install dependencies
run: npm install
working-directory: scripts/mistica-skin-generator

- name: Run tests
run: npm run test
working-directory: scripts/mistica-skin-generator

0 comments on commit c092de5

Please sign in to comment.