From c092de5cb28025343f9c89d7407322957c013354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Meg=C3=ADas?= Date: Wed, 31 Jul 2024 11:47:45 +0200 Subject: [PATCH] IOS-10444 Mistica importer from GH Actions (#390) * 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 --- .github/workflows/generate-mistica-tokens.yml | 50 ++++++++++++------- .../mistica-skin-generator-tests.yml | 30 +++++++++++ 2 files changed, 62 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/mistica-skin-generator-tests.yml diff --git a/.github/workflows/generate-mistica-tokens.yml b/.github/workflows/generate-mistica-tokens.yml index f9de5530..d45a3194 100644 --- a/.github/workflows/generate-mistica-tokens.yml +++ b/.github/workflows/generate-mistica-tokens.yml @@ -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 }}' \ No newline at end of file diff --git a/.github/workflows/mistica-skin-generator-tests.yml b/.github/workflows/mistica-skin-generator-tests.yml new file mode 100644 index 00000000..b9b43fa4 --- /dev/null +++ b/.github/workflows/mistica-skin-generator-tests.yml @@ -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