Skip to content

Commit aca3058

Browse files
committed
feat: 🎸 Major update
BREAKING CHANGE: 🧨 workflow
1 parent c02d16e commit aca3058

File tree

3 files changed

+118
-87
lines changed

3 files changed

+118
-87
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/workflow.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Workflow
2+
on:
3+
push:
4+
paths:
5+
- src/**
6+
- scripts/**
7+
branches:
8+
- main
9+
10+
concurrency:
11+
group:
12+
"${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref ||
13+
github.ref }}"
14+
cancel-in-progress: true
15+
16+
defaults:
17+
run:
18+
shell: sh
19+
20+
jobs:
21+
prepare-environment:
22+
runs-on: ubuntu-latest
23+
name: Prepare environment
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
- uses: actions/setup-node@v3
28+
with:
29+
node-version: "18"
30+
cache: "yarn"
31+
cache-dependency-path: yarn.lock
32+
env:
33+
FORCE_COLOR: 0
34+
- name: Install node_modules on cache miss
35+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
36+
run: yarn install --frozen-lockfile
37+
- name: Cache node_modules
38+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
39+
uses: actions/cache/save@v3
40+
with:
41+
path: node_modules
42+
key: yarn-${{ hashFiles('yarn.lock') }}
43+
44+
tests:
45+
name: Run tests
46+
runs-on: ubuntu-latest
47+
needs: prepare-environment
48+
# Tests timeout after 40 minutes
49+
timeout-minutes: 40
50+
permissions:
51+
contents: read
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v3
55+
- name: Set up Node.js
56+
uses: actions/setup-node@v3
57+
with:
58+
node-version: "18"
59+
cache: "yarn"
60+
cache-dependency-path: yarn.lock
61+
- name: Restore node_modules
62+
uses: actions/cache/restore@v3
63+
id: cache-node-modules
64+
with:
65+
path: node_modules
66+
key: yarn-${{ hashFiles('yarn.lock') }}
67+
fail-on-cache-miss: false
68+
- name: Install node_modules on cache miss
69+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
70+
run: yarn install --frozen-lockfile
71+
- name: Build
72+
run: yarn build
73+
- name: Lint
74+
run: yarn lint
75+
- name: Clear Jest
76+
run: yarn jest --clearCache
77+
- name: Test
78+
run: yarn test --coverage
79+
# - name: Send Report
80+
# uses: paambaati/[email protected]
81+
# env:
82+
# CC_TEST_REPORTER_ID: c206a2ed5aa86c7480a13634e91e440a27a98a5d134653f8ea9a7d5f987e68c3
83+
# with:
84+
# coverageLocations: |
85+
# ${{github.workspace}}/packages/core/coverage/lcov.info:lcov
86+
# ${{github.workspace}}/packages/react/coverage/lcov.info:lcov
87+
88+
release:
89+
name: Release
90+
if: ${{ github.ref == 'refs/heads/main' }}
91+
runs-on: ubuntu-latest
92+
needs: tests
93+
steps:
94+
- name: Checkout
95+
uses: actions/checkout@v3
96+
- name: Set up Node.js
97+
uses: actions/setup-node@v3
98+
with:
99+
node-version: "18"
100+
cache: "yarn"
101+
cache-dependency-path: yarn.lock
102+
- name: Restore node_modules
103+
uses: actions/cache/restore@v3
104+
id: cache-node-modules
105+
with:
106+
path: node_modules
107+
key: yarn-${{ hashFiles('yarn.lock') }}
108+
fail-on-cache-miss: false
109+
- name: Install node_modules on cache miss
110+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
111+
run: yarn install --frozen-lockfile
112+
- name: Build
113+
run: yarn build
114+
- name: Publish
115+
run: yarn release
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)