From 52535e1eabb8f856672bc27451f6738a40bc1d15 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Tue, 4 Aug 2020 16:15:55 +0800 Subject: [PATCH] CI: configure Github Actions Signed-off-by: Jesse Chan --- .github/workflows/build.yml | 23 +++++++++++++++++++ .github/workflows/check-source-formatting.yml | 23 +++++++++++++++++++ .github/workflows/check-types.yml | 23 +++++++++++++++++++ .github/workflows/lint.yml | 23 +++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/check-source-formatting.yml create mode 100644 .github/workflows/check-types.yml create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..e67cad6f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node: [12, 14] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - run: cp config.template.js config.js + - run: npm install + - run: npm run build diff --git a/.github/workflows/check-source-formatting.yml b/.github/workflows/check-source-formatting.yml new file mode 100644 index 00000000..f5666354 --- /dev/null +++ b/.github/workflows/check-source-formatting.yml @@ -0,0 +1,23 @@ +name: Check source formatting + +on: [push, pull_request] + +jobs: + check-source-formatting: + runs-on: ubuntu-latest + + strategy: + matrix: + node: [12, 14] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - run: cp config.template.js config.js + - run: npm install + - run: npm run check-source-formatting diff --git a/.github/workflows/check-types.yml b/.github/workflows/check-types.yml new file mode 100644 index 00000000..ad853384 --- /dev/null +++ b/.github/workflows/check-types.yml @@ -0,0 +1,23 @@ +name: Check types + +on: [push, pull_request] + +jobs: + check-types: + runs-on: ubuntu-latest + + strategy: + matrix: + node: [12, 14] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - run: cp config.template.js config.js + - run: npm install + - run: npm run check-types diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..a6e63f17 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,23 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + + strategy: + matrix: + node: [12, 14] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + - run: cp config.template.js config.js + - run: npm install + - run: npm run lint