diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..71f04aa --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build + +on: ["push", "pull_request"] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v1 + + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Test + run: | + npm ci + npm run build --if-present + npm run coverage || npm test + + - name: File existence + id: check_files + uses: andstor/file-existence-action@v1 + with: + files: ./coverage/lcov.info + + - name: Coveralls + if: steps.check_files.outputs.files_exists == 'true' + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..aea962c --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,31 @@ +name: GitHub Pages + +on: + push: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build Docs + uses: andstor/jsdoc-action@v1 + with: + source_dir: ./src + recurse: true + output_dir: ./out + template_name: minami + front_page: README.md + + - name: Include Examples + run: mv ./examples ./out/ + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} + publish_dir: ./out diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..aceeb0c --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,37 @@ +name: Publish package + +on: + release: + types: + - published + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Test + uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm ci + - run: npm run build --if-present + - run: npm test + + publish-npm: + name: Publish to npm + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3b3da1d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -node_js: - - "9" - - node - -jobs: - include: - - stage: Produce Coverage - node_js: node - script: jest --coverage && cat ./coverage/lcov.info | coveralls diff --git a/README.md b/README.md index d02c3a0..8650c46 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ src="media/voxel.png" alt="Normalize Logo" width="100" height="auto" align="right"> -[![Build Status](https://travis-ci.org/andstor/voxelizer.svg?branch=master)](https://travis-ci.org/andstor/voxelizer) -[![Coverage Status](https://coveralls.io/repos/github/andstor/voxelizer/badge.svg?branch=master)](https://coveralls.io/github/andstor/voxelizer?branch=master) [![npm version](http://img.shields.io/npm/v/voxelizer.svg?style=flat)](https://npmjs.org/package/voxelizer "View this project on npm") +![Build](https://github.com/andstor/voxelizer/workflows/Build/badge.svg) +[![Coverage Status](https://coveralls.io/repos/github/andstor/voxelizer/badge.svg?branch=master)](https://coveralls.io/github/andstor/voxelizer?branch=master) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/andstor/voxelizer.svg?)](https://lgtm.com/projects/g/andstor/voxelizer/context:javascript) Voxelizer is a JavaScript library for conducting voxelization of 3D models.