From 9666889f529f75373819c9a3a4fcff7f7ead2dc0 Mon Sep 17 00:00:00 2001 From: ge Datou <1635656638@qq.com> Date: Wed, 21 Feb 2024 10:59:44 +0800 Subject: [PATCH 1/3] Create main.yml (#2) --- .github/workflows/main.yml | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ef9ac96 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,56 @@ +name: CI + +on: + pull_request: + types: [closed] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Lint + run: npm run lint + + check-label: + runs-on: ubuntu-latest + needs: build + + steps: + - name: Check for QA PASS label + uses: actions/github-script@v5 + with: + script: | + const { data: pullRequest } = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number + }); + + if (!pullRequest.labels.map(label => label.name).includes('QA PASS')) { + throw new Error('Pull request does not have a QA PASS label'); + } + + delete-branch: + runs-on: ubuntu-latest + needs: check-label + + steps: + - name: Delete merged branch + uses: pullreminders/delete-merged-branch@master + if: github.event.pull_request.merged == true + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a910b9ee54f70a3f3656e8be8820a82a9986491b Mon Sep 17 00:00:00 2001 From: ge Datou <1635656638@qq.com> Date: Wed, 21 Feb 2024 11:19:15 +0800 Subject: [PATCH 2/3] Delete .github/workflows/main.yml --- .github/workflows/main.yml | 56 -------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index ef9ac96..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: CI - -on: - pull_request: - types: [closed] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Use Node.js - uses: actions/setup-node@v2 - with: - node-version: '14' - - - name: Install dependencies - run: npm ci - - - name: Build - run: npm run build - - - name: Lint - run: npm run lint - - check-label: - runs-on: ubuntu-latest - needs: build - - steps: - - name: Check for QA PASS label - uses: actions/github-script@v5 - with: - script: | - const { data: pullRequest } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }); - - if (!pullRequest.labels.map(label => label.name).includes('QA PASS')) { - throw new Error('Pull request does not have a QA PASS label'); - } - - delete-branch: - runs-on: ubuntu-latest - needs: check-label - - steps: - - name: Delete merged branch - uses: pullreminders/delete-merged-branch@master - if: github.event.pull_request.merged == true - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 22ec80cd672a2227e596575ddb47cf5e8175c089 Mon Sep 17 00:00:00 2001 From: ge Datou <1635656638@qq.com> Date: Wed, 21 Feb 2024 11:19:46 +0800 Subject: [PATCH 3/3] Create main.yml --- .github/workflows/main.yml | 81 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..aa39a9a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,81 @@ +name: demo + +on: + push: + branches: + - main + - next + + pull_request: + branches: + - main + - next + + merge_group: {} + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + + - name: Set node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: pnpm + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Lint + run: nr lint + + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node: [16.x, 18.x, 20.x] + fail-fast: false + + steps: + - uses: actions/checkout@v3 + + - name: Install pnpm + uses: pnpm/action-setup@v2 + + - name: Set node version to ${{ matrix.node }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + cache: pnpm + + - name: Setup + run: npm i -g @antfu/ni + + - name: Install + run: nci + + - name: Build + run: nr build + + - name: Typecheck + run: nr typecheck + + - name: Test Vue 3 + run: pnpm run test:3 + + - name: Test Vue 2 + run: pnpm run test:2 + + - if: matrix.node == '18.x' + name: Playground Smoke Test + run: cd playgrounds && bash ./build.sh