feat(CI): use github action (#5987)

This commit is contained in:
Florent BEAUCHAMP 2022-03-11 17:18:21 +01:00 committed by GitHub
parent db75f8046c
commit 0a412c0ef7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 23 deletions

13
.github/workflows/push.yml vendored Normal file
View File

@ -0,0 +1,13 @@
name: CI
on: [push]
jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: satackey/action-docker-layer-caching@v0.0.11
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
- run: docker-compose -f docker/docker-compose.dev.yml build
- run: docker-compose -f docker/docker-compose.dev.yml up

View File

@ -1,23 +0,0 @@
language: node_js
node_js:
- 14
# Use containers.
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false
addons:
apt:
packages:
- qemu-utils
- blktap-utils
- vmdk-stream-converter
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
cache:
yarn: true
script:
- yarn run travis-tests

24
docker/Dockerfile Normal file
View File

@ -0,0 +1,24 @@
#last version of ubuntu with blktap-utils
FROM ubuntu:xenial
# https://qastack.fr/programming/25899912/how-to-install-nvm-in-docker
RUN apt-get update
RUN apt-get install -y curl qemu-utils blktap-utils vmdk-stream-converter git
ENV NVM_DIR /usr/local/nvm
RUN mkdir -p /usr/local/nvm
RUN cd /usr/local/nvm
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
ENV NODE_VERSION v17.0.1
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION"
ENV NODE_PATH $NVM_DIR/versions/node/$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH
RUN npm install -g yarn
WORKDIR /xen-orchestra
# invalidate build on package change
COPY ./yarn.lock /xen-orchestra/yarn.lock
ENTRYPOINT yarn ci

View File

@ -0,0 +1,11 @@
version: '3.3'
services:
xo:
build:
context: "${PWD}"
dockerfile: "${PWD}/docker/Dockerfile"
ports:
- 8000:80
volumes:
- ${PWD}:/xen-orchestra

View File

@ -70,6 +70,7 @@
"private": true,
"scripts": {
"build": "scripts/run-script --parallel build",
"ci": "yarn && yarn test-integration",
"clean": "scripts/run-script --parallel clean",
"dev": "scripts/run-script --parallel dev",
"dev-test": "jest --bail --watch \"^(?!.*\\.integ\\.spec\\.js$)\"",