Skip to content

Commit

Permalink
增强工作流可读性 #673
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltus committed May 1, 2024
1 parent 4005663 commit 96d15f1
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 17 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/Codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,32 @@ jobs:
repo_owner: "Hi-Windom"
package_json: "app/package.json"
steps:
- name: Checkout repository and submodules
- name: ☄️ Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Extract packageManager from package.json
- name: 💫 Extract packageManager from package.json
uses: sergeysova/jq-action@v2
id: packageManager
with:
cmd: "jq .packageManager ${{ matrix.string.package_json }} -r"
- name: Extract actionInstallCommand from package.json
- name: 💫 Extract actionInstallCommand from package.json
uses: sergeysova/jq-action@v2
id: actionInstallCommand
with:
cmd: "jq .actionInstallCommand ${{ matrix.string.package_json }} -r"
- name: Set up Node
- name: 🔨 Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Node pnpm
- name: 🔨 Install Node pnpm
run: npm install -g ${{ steps.packageManager.outputs.value }}
working-directory: app
- name: Install dependencies
- name: 🚀 Install dependencies
run: ${{ steps.actionInstallCommand.outputs.value }}
working-directory: app
- name: Run tests and collect coverage
- name: 💥 Run tests and collect coverage
run: pnpm run test
working-directory: app
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- name: 📤 Upload coverage to Codecov
uses: codecov/codecov-action@v4
4 changes: 2 additions & 2 deletions .github/workflows/aci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
runs-on: ubuntu-latest
name: afterCI action
steps:
- name: Install dependencies
- name: 🚀 Install dependencies
run: npm install axios
- name: Get Latest Release Assets
- name: 🧲 Get Latest Release Assets
id: latest_release
uses: actions/github-script@v7
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ jobs:
- name: ✍️ Change NPMRC File
run: pnpm config set registry https://registry.npmjs.org/ --location project
working-directory: ${{ github.workspace }}/${{ env.repo_owner }}/${{ env.repo_name }}/app
- name: Install Node Dependencies

- name: 🚀 Install Node Dependencies
run: ${{ needs.create_release.outputs.actionInstallCommand }}
working-directory: ${{ github.workspace }}/${{ env.repo_owner }}/${{ env.repo_name }}/app

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
- name: ☄️ Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- name: 🔨 Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
Expand All @@ -65,7 +65,7 @@ jobs:

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
- name: 💥 Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
Expand All @@ -78,7 +78,7 @@ jobs:
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
- name: 💥 Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
with:
cmd: "jq .version ${{ env.package_json }} -r"

- name: 💿 Free Disk Space (Ubuntu)
- name: 🗑️ Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: action 文件规范
---
## 步骤名称开头的 emoji

随着 action 文件越来越复杂,文件和 Github action 界面的可读性都不可避免面临一定程度的挑战,因此我们约定通过下面的 emoji 规范命名步骤,推荐搭配微软拼音输入法使用

1. ☄️ 彗星:检出仓库
2. 🔨 锤子:准备工具
3. 💫 头晕:获取值、字段、属性等
4. 📃 带卷边的页面:生成非日志、非持久化的输出
5. 🚩 三角旗:创建发布
6. ✅ 勾号按钮:检查
7. 📦 包裹:打包
8. ✍️ 写字:写入或修改文件
9. 🗑️ 垃圾桶:清理文件、目录;释放空间
10. 🔥 火焰:构建
11. 📤 发件箱:上传;发送
12. 💥 爆炸:运行脚本
13. 🌠 流星:签名
14. 🧲 磁铁:获取资产;下载
15. 🚀 安装依赖

0 comments on commit 96d15f1

Please sign in to comment.