From dc1ce9509851bda55f9bed9a37838531993d38ad Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 28 Sep 2022 17:45:57 +0800 Subject: [PATCH] ci: migrate to GitHub Actions (#280) --- .github/workflows/continuous-integration.yml | 67 ++++++++++++++++++++ .travis.yml | 23 ------- 2 files changed, 67 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/continuous-integration.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 00000000..4565725e --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,67 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + # schedule: + # - cron: "0 23 * * 6" + +jobs: + test: + strategy: + fail-fast: false + matrix: + os: + - "ubuntu-latest" + - "macos-latest" + - "windows-latest" + node_version: + - "18" + - "16" + - "14" + - "12" + - "10" + - "8" + - "6" + name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node_version }} + + - name: Install Dependencies + run: yarn + + - name: Run Test + run: yarn test + + - uses: codecov/codecov-action@v3 + with: + fail_ci_if_error: true + + lint: + name: Lint + runs-on: ubuntu-latest + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + + - name: Install Dependencies + run: yarn + + - name: Run Lint + run: yarn lint diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1f30effa..00000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: node_js - -node_js: -- 6 -- stable - -before_install: -- yarn global add codecov - -script: -- yarn run lint -- yarn run test - -after_script: -- codecov - -cache: - yarn: true - directories: - - node_modules - -matrix: - fast_finish: true