From 9d64e125296afbcb7d065efbece435159428fec1 Mon Sep 17 00:00:00 2001 From: Shigma Date: Wed, 15 Nov 2023 02:29:06 +0800 Subject: [PATCH] build: refine build workflow --- .github/workflows/build.yml | 67 +++++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 32 ------------------ .github/workflows/test.yml | 35 ------------------- 3 files changed, 67 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..366d17b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,67 @@ +name: Build + +on: + push: + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + + - name: Cache Yarn dependencies + uses: ./.github/actions/cache + with: + os: ${{ runner.os }} + + - name: Install dependencies + run: yarn install + + - name: Lint JavaScript + run: yarn lint + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + + - name: Cache Yarn dependencies + uses: ./.github/actions/cache + with: + os: ${{ runner.os }} + + - name: Install dependencies + run: yarn install + + - name: Lint JavaScript + run: yarn build + + test: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + version: [18, 20] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.version }} + + - name: Cache Yarn dependencies + uses: ./.github/actions/cache + with: + os: ${{ runner.os }} + + - name: Install dependencies + run: yarn install + + - name: Test + run: yarn test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 73f2023..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Lint - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - lint: - strategy: - matrix: - version: [16, 18, 20] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.version }} - - - name: Cache Yarn dependencies - uses: ./.github/actions/cache - with: - os: ${{ runner.os }} - - - name: Install dependencies - run: yarn install - - - name: Lint JavaScript - run: yarn run lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 2be0298..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Test - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - test: - strategy: - matrix: - version: [16, 18, 20] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.version }} - - - name: Cache Yarn dependencies - uses: ./.github/actions/cache - with: - os: ${{ runner.os }} - - - name: Install dependencies - run: yarn install - - - name: Build - run: yarn run build - - - name: Test - run: yarn run test