Add git/aws workflow #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow builds a xar archive, deploys it into exist and execute its test suites. | |
# 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 | |
name: exist-db CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
exist-version: [latest, release] | |
java-version: [8, 17] | |
node-version: ['18', '20'] | |
exclude: | |
- exist-version: release | |
java-version: 17 | |
- exist-version: latest | |
java-version: 8 | |
# TODO: see #563 could still be usefull for gulp builds | |
# services: | |
# # Label used to access the service container | |
# exist: | |
# image: existdb/existdb:${{ matrix.exist-version}} | |
# ports: | |
# - 8080:8080 | |
steps: | |
# Checkout code | |
- uses: actions/checkout@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
# Build Frontend | |
- name: Build Frontend Using Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- run: npm ci | |
# Build Expath Package | |
# TODO: #563 make optional for gulp builds | |
- name: Build Expath Package | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java-version }} | |
- run: ant | |
# Deploy Package in Container | |
- name: Pull Base Image | |
run: docker pull existdb/existdb:${{ matrix.exist-version }} | |
- name: Create CI Container | |
run: docker create --name exist-ci -p 8080:8080 existdb/existdb:${{ matrix.exist-version }} | |
- name: Prep CI Container | |
run: docker cp ./build/*-dev.xar exist-ci:exist/autodeploy | |
- name: Start Exist Container | |
run: docker start exist-ci && sleep 30 | |
# Testing | |
- name: Run Unit Tests | |
run: npm test | |
- name: Run Integration Tests | |
run: npm run cypress | |
# TODO: Add upload to dockerhub | |
# release: | |
# name: Release | |
# runs-on: ubuntu-latest | |
# needs: build | |
# if: github.ref == 'refs/heads/main' | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v2 | |
# with: | |
# fetch-depth: 0 | |
# - name: Setup Node.js | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: 18 | |
# cache: 'npm' | |
# - name: Install dependencies | |
# run: npm ci | |
# - name: Create package | |
# run: npm run build | |
# - name: Release | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# run: npx semantic-release | |