From 3a01a44f1f09200208ef7a91835e9975ae690c41 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 14 Sep 2021 01:51:51 -0500 Subject: [PATCH] chore: add github actions --- .github/workflows/CI.yml | 90 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..03f558d8 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,90 @@ +name: CI +on: + pull_request: + push: + branches: + - master + - main + +jobs: + Test: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - windows-2019 + - ubuntu-20.04 + - macos-10.15 + node: + - 14 # installed on the images + pnpm: + - 6 + steps: + - uses: actions/checkout@v2 + + - name: Cache + uses: actions/cache@v2 + with: + path: | + ~/.pnpm-store + D:\.pnpm-store + key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}" + restore-keys: | + "setupcpp-cache-OS:${{ matrix.os }}" + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + + - name: Setup Pnpm + uses: pnpm/action-setup@v2 + with: + version: ${{ matrix.pnpm }} + + - name: Install and build + run: | + pnpm install + + Lint: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Commit lint ✨ + uses: wagoid/commitlint-github-action@v2 + + - name: Cache + uses: actions/cache@v2 + with: + path: | + ~/.pnpm-store + D:\.pnpm-store + key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}" + restore-keys: | + "setupcpp-cache-OS:${{ matrix.os }}" + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + + - name: Setup Pnpm + uses: pnpm/action-setup@v2 + with: + version: ${{ matrix.pnpm }} + + - name: Install dependencies + run: pnpm install + + - name: Format ✨ + run: pnpm run test.format + + - name: Lint ✨ + run: pnpm run test.lint \ No newline at end of file