11name : CI
22on :
33 push :
4- branches : [main]
4+ branches :
5+ # default semantic-release branches
6+ - +([0-9])?(.{+([0-9]),x}).x
7+ - main
8+ - next
9+ - next-major
10+ - beta
11+ - alpha
512 pull_request :
613 schedule :
714 - cron : 0 0 * * 0
815
916jobs :
1017 lint :
18+ name : ⬣ Lint
1119 runs-on : ubuntu-latest
1220 steps :
13- - name : Checkout
21+ - name : 🛑 Cancel Previous Runs
22+ uses : styfle/cancel-workflow-action@0.11.0
23+
24+ - name : ⬇️ Checkout repo
1425 uses : actions/checkout@v3
1526
16- - name : Install Node
27+ - name : ⎔ Setup Node
1728 uses : actions/setup-node@v3
1829 with :
1930 node-version : 18
2031
21- - name : Install Packages
32+ - name : 📥 Install dependencies
2233 run : npm install
2334
24- - name : Lint
35+ - name : ▶️ Run lint script
2536 run : npm run lint
2637
2738 test :
28- name : Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{ matrix.os }})
39+ name :
40+ 🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{
41+ matrix.os }})
2942 strategy :
3043 matrix :
3144 eslint : [6]
@@ -45,24 +58,65 @@ jobs:
4558 os : ubuntu-latest
4659 runs-on : ${{ matrix.os }}
4760 steps :
48- - name : Checkout
61+ - name : 🛑 Cancel Previous Runs
62+ uses : styfle/cancel-workflow-action@0.11.0
63+
64+ - name : ⬇️ Checkout repo
4965 uses : actions/checkout@v3
5066
51- - name : Install Node@ ${{ matrix.node }}
67+ - name : ⎔ Setup Node v ${{ matrix.node }}
5268 uses : actions/setup-node@v3
5369 with :
5470 node-version : ${{ matrix.node }}
5571
56- - name : Install Packages
72+ - name : 📥 Install dependencies
5773 run : npm install
5874
59- # - name: Install ESLint@ ${{ matrix.eslint }}
60- # run: npm install eslint@${{ matrix.eslint }}
75+ # - name: 📥 Install ESLint v ${{ matrix.eslint }}
76+ # run: npm install --save-dev eslint@${{ matrix.eslint }}
6177
62- - name : Test
78+ - name : ▶️ Run test script
6379 run : npm run test
6480
65- # - name: Send Coverage
66- # run: npm run -s codecov
67- # env:
68- # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
81+ - name : ⬆️ Upload coverage report
82+ uses : codecov/codecov-action@v3
83+
84+ release :
85+ name : 🚀 Release
86+ needs : [lint, test]
87+ runs-on : ubuntu-latest
88+ if :
89+ github.repository == 'eslint-community/eslint-plugin-mysticatea' &&
90+ contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
91+ github.ref) && github.event_name == 'push'
92+ steps :
93+ - name : 🛑 Cancel Previous Runs
94+ uses : styfle/cancel-workflow-action@0.11.0
95+
96+ - name : ⬇️ Checkout repo
97+ uses : actions/checkout@v3
98+
99+ - name : ⎔ Setup node
100+ uses : actions/setup-node@v3
101+ with :
102+ node-version : 18
103+
104+ - name : 📥 Install dependencies
105+ run : npm install
106+
107+ - name : 🚀 Release
108+ uses : cycjimmy/semantic-release-action@v3
109+ with :
110+ semantic_version : 19
111+ branches : |
112+ [
113+ '+([0-9])?(.{+([0-9]),x}).x',
114+ 'main',
115+ 'next',
116+ 'next-major',
117+ {name: 'beta', prerelease: true},
118+ {name: 'alpha', prerelease: true}
119+ ]
120+ env :
121+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
122+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments