diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 58e59fb..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,57 +0,0 @@ -version: 2 - -workflows: - version: 2 - mandle-workflow: - jobs: - - test - - publish: - requires: - - test - filters: - branches: - only: - - master - -jobs: - test: - docker: - - image: node:latest - working_directory: ~/repo - steps: - - checkout: - path: ~/repo - - restore_cache: - key: yarn-cache-{{ checksum "yarn.lock" }} - - run: - name: install-dependencies - command: yarn install - - run: - name: run-tests - command: yarn test --coverage - - run: - name: build-bundle - command: yarn build - - persist_to_workspace: - root: ./ - paths: - - dist - - node_modules - - save_cache: - key: yarn-cache-{{ checksum "yarn.lock" }} - paths: - - node_modules - - run: - name: upload-coverage - command: bash <(curl -s https://codecov.io/bash) - - publish: - docker: - - image: node:latest - working_directory: ~/repo - steps: - - checkout: - path: ~/repo - - attach_workspace: - at: ./ - - run: yarn semantic-release || true \ No newline at end of file diff --git a/.github/workflows/build-n-test.yml b/.github/workflows/build-n-test.yml new file mode 100644 index 0000000..bf44d28 --- /dev/null +++ b/.github/workflows/build-n-test.yml @@ -0,0 +1,58 @@ +name: Node CI + +on: [push] + +jobs: + build-n-test: + name: Build and test + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 10.x + uses: actions/setup-node@v1 + with: + node-version: 10.x + + - name: Cache node modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-deps-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-deps-${{ hashFiles('**/yarn.lock') }} + ${{ runner.OS }}-deps- + + - name: Install deps + run: yarn install + + - name: Build js + run: yarn build + + - name: Run tests + run: yarn test --coverage + + - name: Upload built package + uses: actions/upload-artifact@v1.0.0 + with: + name: dist + path: dist + + + publish: + runs-on: ubuntu-18.04 + needs: build-n-test + + steps: + - uses: actions/checkout@v1 + + - name: Download built package + uses: actions/download-artifact@v1.0.0 + with: + name: dist + + - name: Semantic release + run: npx semantic-release + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} \ No newline at end of file