mirror of
https://github.com/maptiler/tileserver-gl.git
synced 2024-09-11 03:55:27 +03:00
build: move to GitHub Actions workflow(s) (#597)
* build: add `Pipeline` GitHub Action workflow(s) Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * refactor(build): use CT action instead of travis-ci Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * chore: remove `main` branch Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * build: add `ct` workflow in The Pipeline 🕺 Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * revert: remove builder workflow to automate deployments on `ghcr.io` Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * build(ci): upgrade node version to 17 Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * build: use node version from `"engines"` https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#node-version-file Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * chore: run linter(s) once we have linting tools in place Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * fix: file name for automerger workflow Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * fix: run workflow on protected branch Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * chore: ignore hadolint rules Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * fix: setup-node after checkout repo Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * fix: remove deprecated ::set-output Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * style: fix Dockerfile lint issues Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * chore(deps): upgrade pinned libcurl4 package Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * feat: add codeql workflow https: //github.com/github/codeql-action/ Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * fix: enable Lint check in CI cause #626 is merged! ❤️ Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * feat: add publishConfig in `package.json` 🕺 Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * style: remove extra space Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * feat: add builder workflow 🎉 Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * perf: enable `npm ci` since we now have lockfile 🕺 Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * refactor!: remove pipeline and just enable automerger & CI Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * refactor: enable codeql & remove CI Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * revert: old files unneeded in this PR Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * revert: remove hadolint config Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * build: enable CT as per @acalcutt review Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * fix: remove travis cause CT workflow Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> * force ubuntu-20.04 Testing fails on ubuntu-latest due to no libicu66 being available in ubuntu 22.04 * simplify dependencies install * add publish workflow * remove automerger for now Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com> Co-authored-by: acalcutt <acalcutt@techidiots.net>
This commit is contained in:
parent
ac3b2f3dce
commit
6e7c3eb3b3
19
.github/dependabot.yml
vendored
Normal file
19
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
versioning-strategy: increase
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: daily
|
||||
commit-message:
|
||||
prefix: fix
|
||||
prefix-development: chore
|
||||
include: scope
|
||||
- package-ecosystem: github-actions
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: weekly
|
||||
commit-message:
|
||||
prefix: fix
|
||||
prefix-development: chore
|
||||
include: scope
|
35
.github/workflows/codeql.yml
vendored
Normal file
35
.github/workflows/codeql.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: '45 23 * * 2'
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [javascript]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
queries: +security-and-quality
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
with:
|
||||
category: '/language:${{ matrix.language }}'
|
57
.github/workflows/ct.yml
vendored
Normal file
57
.github/workflows/ct.yml
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
name: 'Continuous Testing'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
checks: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
ct:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- 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: Update apt-get 🚀
|
||||
run: sudo apt-get update -qq
|
||||
|
||||
- name: Install dependencies (Ubuntu) 🚀
|
||||
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: 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: 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
|
103
.github/workflows/release.yml
vendored
Normal file
103
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,103 @@
|
||||
name: "Build, Test, Release"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
docker_user:
|
||||
description: 'Docker Username'
|
||||
required: true
|
||||
docker_token:
|
||||
description: 'Docker Token'
|
||||
required: true
|
||||
npm_token:
|
||||
description: 'NPM Token'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: "Build, Test, Publish"
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Check out repository ✨
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Update apt-get 🚀
|
||||
run: sudo apt-get update -qq
|
||||
|
||||
- name: Install dependencies (Ubuntu) 🚀
|
||||
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: 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: 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
|
||||
|
||||
- name: Remove Test Data
|
||||
run: rm -R test_data*
|
||||
|
||||
- name: Publish to Full Version NPM
|
||||
run: |
|
||||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
||||
npm publish --access public
|
||||
env:
|
||||
NPM_TOKEN: ${{ github.event.inputs.npm_token }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ github.event.inputs.docker_user }}
|
||||
password: ${{ github.event.inputs.docker_token }}
|
||||
|
||||
- name: Build and publish Full Version to Docker Hub
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: maptiler/tileserver-gl:latest, maptiler/tileserver-gl:${{ env.PACKAGE_VERSION }}
|
||||
platforms: linux/amd64
|
||||
|
||||
- name: Create Tileserver Light Directory
|
||||
run: node publish.js --no-publish
|
||||
|
||||
- name: Install node dependencies
|
||||
run: npm install
|
||||
working-directory: ./light
|
||||
|
||||
- name: Publish to Light Version NPM
|
||||
working-directory: ./light
|
||||
run: |
|
||||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
||||
npm publish --access public
|
||||
env:
|
||||
NPM_TOKEN: ${{ github.event.inputs.npm_token }}
|
||||
|
||||
- name: Build and publish Light Version to Docker Hub
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./light
|
||||
file: ./light/Dockerfile
|
||||
push: true
|
||||
tags: maptiler/tileserver-gl-light:latest, maptiler/tileserver-gl-light:${{ env.PACKAGE_VERSION }}
|
||||
platforms: linux/amd64
|
21
.travis.yml
21
.travis.yml
@ -1,21 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "10"
|
||||
env:
|
||||
- CXX=g++-4.8
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.8
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
|
||||
- sudo apt-get install -qq xvfb libgles2-mesa-dev libgbm-dev libxxf86vm-dev
|
||||
install:
|
||||
- npm install
|
||||
- wget -O test_data.zip https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip
|
||||
- unzip -q test_data.zip -d test_data
|
||||
script:
|
||||
- xvfb-run --server-args="-screen 0 1024x768x24" npm test
|
Loading…
Reference in New Issue
Block a user