diff --git a/.github/workflows/build.yml b/.github/workflows/ci.yml similarity index 75% rename from .github/workflows/build.yml rename to .github/workflows/ci.yml index 0c5fa5f..c9f258a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,8 @@ -name: Build and Deploy +name: CI env: CI: true + NODE: 12.x PYTHON_VERSION: '3.7' on: [push, pull_request] @@ -35,14 +36,36 @@ jobs: - name: Upload docs uses: actions/upload-artifact@v1 - if: success() && github.ref == 'refs/heads/master' with: name: docs path: ./site/ - deploy: + test: runs-on: ubuntu-latest needs: build + steps: + - uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: "${{ env.NODE }}" + + - name: Install npm dependencies + run: npm ci + + - name: Download docs + uses: actions/download-artifact@v1 + with: + name: docs + path: ./site/ + + - name: Test + run: npm test + + deploy: + runs-on: ubuntu-latest + needs: [build, test] if: github.ref == 'refs/heads/master' steps: @@ -56,7 +79,6 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v3 - if: success() with: emptyCommits: false personal_token: ${{ secrets.PERSONAL_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index faed76f..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Test - -env: - CI: true - -on: [push, pull_request] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Set up Node.js - uses: actions/setup-node@v1 - with: - node-version: '12' - - - name: Install npm dependencies - run: npm ci - - - name: Test - run: npm test