Files
PMTiles/.github/workflows/actions.yml
Brandon Liu 10e24d9437 fix CI
2022-10-25 00:37:51 +08:00

49 lines
1.7 KiB
YAML

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build_app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: cd js && npm install && npm run build
- run: echo "VITE_GIT_SHA=$(git rev-parse --short HEAD)" >> app/.env
- run: cd app && npm install && ./node_modules/.bin/tsc && ./node_modules/.bin/vite build --base=/PMTiles/
- run: cd serverless/aws && npm install && npm run build && cp dist/lambda_function.zip ../../app/dist
- run: cd serverless/cloudflare && npm install && npm run build && cp dist/index.js ../../app/dist
- run: cd spec/v3 && cp *.pmtiles ../../app/dist
- run: cd js/examples && mkdir ../../app/dist/examples && cp *.html ../../app/dist/examples/
- name: build_app
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./app/dist
force_orphan: true
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: cd js && npm install && npm test
- run: cd python && python -m unittest test/test_*
- run: cd cpp && make
- run: cd serverless/cloudflare && npm install && npm test