From 4352675894d0c3f9356797498500480667b89222 Mon Sep 17 00:00:00 2001 From: duncdrum Date: Thu, 28 Dec 2023 20:55:40 +0100 Subject: [PATCH] fix(ci): migrate to gha update docker --- .github/dependabot.yml | 10 ++++++ .github/workflows/ci.yml | 75 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 17 --------- test/Dockerfile | 6 ++-- 4 files changed, 89 insertions(+), 19 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d906e19 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" +- package-ecosystem: npm + directory: "/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dbfd944 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +# This workflow builds a xar archive, deploys it into exist and execute a simple smoke test. +# It also includes code for using semantic-release to upload packages as part of GitHub releases +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# For node free automated release see https://trstringer.com/github-actions-create-release-upload-artifacts/ + +name: exist-db CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # 7.0.0-SNAPSHOT and 6.2.0 created + exist-version: [5.2.0, latest, release] + node-version: [18, 20] + + steps: + # Checkout code + - uses: actions/checkout@v4 + + # Build + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + # Install + - run: npm ci + + # Test + - name: Build default images for testing on CI + uses: docker/build-push-action@v5 + with: + context: . + file: ./test/Dockerfile + build-args: EXIST_VER=${{ matrix.exist-version }} + load: true + tags: exist-vs + + - name: Start exist-ci containers + run: | + docker run -dit -p 8080:8080 --name exist --rm exist-vs + sleep 10s + + - name: Run test + run: npm test + + # Lint commit messages + # - name: lint commit message + # uses: wagoid/commitlint-github-action@v5 + +# release: +# name: Release +# runs-on: ubuntu-latest +# needs: build +# if: github.ref == 'refs/heads/master' +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Setup Node.js +# uses: actions/setup-node@v4 +# with: +# cache: npm +# node-version: lts/* +# - name: Install dependencies +# run: npm ci --no-optional +# - name: Perform Release +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# PUBLIC_REPO: ${{ secrets.PUBLIC_REPO }} +# run: npx semantic-release \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8d0fb74..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -dist: xenial - -language: node_js -node_js: - - 8 - - 10 - - 12 - -services: - - docker - - xvfb - -before_install: - # get exist instance running with atom lib installed - - docker build -t exist-vs test/. - - docker run -dit -p 8080:8080 exist-vs - - sleep 25 \ No newline at end of file diff --git a/test/Dockerfile b/test/Dockerfile index f89663d..042f30b 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -1,3 +1,5 @@ -FROM existdb/existdb:5.0.0 +ARG EXIST_VER=5.0.0 -ADD https://github.com/eXist-db/atom-editor-support/releases/download/v1.0.0/atom-editor-1.0.0.xar /exist/autodeploy \ No newline at end of file +FROM duncdrum/existdb:${EXIST_VER} + +ADD https://github.com/eXist-db/atom-editor-support/releases/latest/download/atom-editor-1.1.0.xar /exist/autodeploy \ No newline at end of file