From a6842b97f922b4dfffd20972decf0aba79b859d0 Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> Date: Fri, 2 Dec 2022 01:52:30 +0530 Subject: [PATCH] build: enable CT as per @acalcutt review Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> --- .github/workflows/ct.yml | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/ct.yml diff --git a/.github/workflows/ct.yml b/.github/workflows/ct.yml new file mode 100644 index 0000000..c5220d2 --- /dev/null +++ b/.github/workflows/ct.yml @@ -0,0 +1,62 @@ +name: 'Continuous Testing' + +on: + push: + branches: + - master + pull_request: + branches: + - master + +permissions: + checks: write + contents: read + +jobs: + ct: + runs-on: ubuntu-latest + steps: + - name: Install dependencies (Ubuntu) + run: |- + sudo apt-get update + sudo apt-get install -y g++-9 + + - name: Check out repository โœจ (non-dependabot) + if: ${{ github.actor != 'dependabot[bot]' }} + uses: actions/checkout@v3 + + - name: Check out repository ๐ŸŽ‰ (dependabot) + if: ${{ github.actor == 'dependabot[bot]' }} + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Setup node env ๐Ÿ“ฆ + uses: actions/setup-node@v3 + with: + node-version-file: 'package.json' + check-latest: true + cache: 'npm' + + - name: Install dependencies ๐Ÿš€ + run: npm ci --prefer-offline --no-audit --omit=optional + + - name: Update apt-get ๐Ÿš€ + run: sudo apt-get update -qq + + - name: Install required packages ๐Ÿš€ + run: >- + sudo apt-get install -qq libcairo2-dev libjpeg8-dev libpango1.0-dev + libgif-dev build-essential g++ xvfb libgles2-mesa-dev libgbm-dev + libxxf86vm-dev + + - name: Pull test data ๐Ÿ“ฆ + run: >- + wget -O test_data.zip + https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip + + - name: Prepare test data ๐Ÿ“ฆ + run: unzip -q test_data.zip -d test_data + + - name: Run tests ๐Ÿงช + run: xvfb-run --server-args="-screen 0 1024x768x24" npm test