From f3ab68d5d8f226d0417a4be2cb0368dd3ad12d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 24 Feb 2020 11:07:28 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20CI:=20fix=20azure=20ci=20(#6004)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 👷 CI: try fix azure ci * 👷 CI : remove node@8 version * 👷 CI : fix window ci error * 🙈 ignore: ignore CNAME * 👷 CI : open HEADLESS * 👷 CI : new rebase script * 👷 CI :add issue auto reference * 👷 CI :add GitHub_Pages_Deploy action * 👷 CI :add GitHub_Pages_Deploy action --- .github/GitHub_Pages_Deploy.workflow | 7 +++++++ .github/issue-reference.workflow | 11 +++++++++++ .github/workflows/ci.yml | 5 ++--- .github/workflows/rebase.yml | 13 +++++++++++-- .prettierignore | 3 ++- azure-pipelines.yml | 8 ++++---- package.json | 2 +- 7 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 .github/GitHub_Pages_Deploy.workflow create mode 100644 .github/issue-reference.workflow diff --git a/.github/GitHub_Pages_Deploy.workflow b/.github/GitHub_Pages_Deploy.workflow new file mode 100644 index 00000000..b44af763 --- /dev/null +++ b/.github/GitHub_Pages_Deploy.workflow @@ -0,0 +1,7 @@ +action "Deploy to GitHub Pages" { + uses = "maxheld83/ghpages@v0.2.1" + env = { + BUILD_DIR = "dist/" + } + secrets = ["ACTION_TOKEN"] +} diff --git a/.github/issue-reference.workflow b/.github/issue-reference.workflow new file mode 100644 index 00000000..a15f2291 --- /dev/null +++ b/.github/issue-reference.workflow @@ -0,0 +1,11 @@ +workflow "Add an issue reference to a pull request" { + on = "pull_request" + resolves = "Add an issue reference" +} + +action "Add an issue reference" { + uses = "kentaro-m/add-an-issue-reference-action@master" + secrets = ["ACTION_TOKEN"] + # branch name prefix + args = "{\"branch\":\"issue\"}" +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc6f072f..635fe115 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node_version: [8.x, 10.x, 12.x] + node_version: [10.x, 12.x] os: [ubuntu-latest, windows-latest, macOS-latest] steps: - uses: actions/checkout@v1 @@ -19,10 +19,9 @@ jobs: - run: yarn run lint - run: yarn run tsc - run: yarn run build - - run: yarn run test + - run: yarn run test:all env: CI: true - HEADLESS: false PROGRESS: none NODE_ENV: test NODE_OPTIONS: --max_old_space_size=4096 diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index 82f83d4d..85dc5606 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -5,10 +5,19 @@ name: Automatic Rebase jobs: rebase: name: Rebase + if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') runs-on: ubuntu-latest steps: - uses: actions/checkout@master + with: + fetch-depth: 0 - name: Automatic Rebase - uses: cirrus-actions/rebase@master + uses: cirrus-actions/rebase@1.2 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} + always_job: + name: Always run job + runs-on: ubuntu-latest + steps: + - name: Always run + run: echo "This job is used to prevent the workflow to fail when all other jobs are skipped." diff --git a/.prettierignore b/.prettierignore index 4fa82fc9..87715a7d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -17,4 +17,5 @@ LICENSE .eslintcache *.lock yarn-error.log -.history \ No newline at end of file +.history +CNAME diff --git a/azure-pipelines.yml b/azure-pipelines.yml index de92a14f..983764f2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,7 +16,7 @@ jobs: steps: - checkout: self clean: false - - script: npm install + - script: yarn displayName: install - script: npm run lint displayName: lint @@ -36,7 +36,7 @@ jobs: options: '-u root' steps: - - script: npm install + - script: yarn displayName: install - script: npm run test:all env: @@ -51,7 +51,7 @@ jobs: - task: NodeTool@0 inputs: versionSpec: '11.x' - - script: npm install + - script: yarn displayName: install - script: npm run lint displayName: lint @@ -74,7 +74,7 @@ jobs: - task: NodeTool@0 inputs: versionSpec: '11.x' - - script: npm install + - script: yarn displayName: install - script: npm run lint displayName: lint diff --git a/package.json b/package.json index f4daebdf..968aefd8 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "gh-pages": "cp CNAME ./dist/ && gh-pages -d dist", "i18n-remove": "pro i18n-remove --locale=zh-CN --write", "lint": "npm run lint:js && npm run lint:style && npm run lint:prettier", - "lint:prettier": "prettier --check \"**/*\"", + "lint:prettier": "prettier --check \"**/*\" --end-of-line auto", "lint-staged": "lint-staged", "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ", "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && npm run lint:style",