chore(ci): no longer rely on Docker (#6687)

This commit is contained in:
Gabriel Gunullu
2023-03-06 13:10:27 +01:00
committed by GitHub
parent 617619eb31
commit ef1f09cd4a
7 changed files with 39 additions and 50 deletions

32
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Continous Integration
on: push
jobs:
CI:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v3
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y curl qemu-utils python3-vmdkstream git libxml2-utils libfuse2 nbdkit
- name: Cache Turbo
# https://github.com/actions/cache
uses: actions/cache@v3
with:
path: '**/node_modules/.cache/turbo'
key: ${{ runner.os }}-turbo-cache
- name: Setup Node environment
# https://github.com/actions/setup-node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
- name: Install project dependencies
run: yarn
- name: Build the project
run: yarn build
- name: Lint tests
run: yarn test-lint
- name: Integration tests
run: sudo yarn test-integration

View File

@@ -1,12 +0,0 @@
name: CI
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build docker image
run: docker-compose -f docker/docker-compose.dev.yml build
- name: Create the container and start the tests
run: docker-compose -f docker/docker-compose.dev.yml up --exit-code-from xo

View File

@@ -1,24 +0,0 @@
#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 vmdk-stream-converter git libxml2-utils libfuse2 nbdkit
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 v16.17.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

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

View File

@@ -57,7 +57,9 @@ test('An ova file is parsed correctly', async () => {
await writeFile(ovfName, xmlContent)
const rawFileName = 'random-data'
await exec(`base64 /dev/urandom | head -c 104448 > ${rawFileName}`)
await exec(`rm -f ${vmdkFileName} && python /usr/share/pyshared/VMDKstream.py ${rawFileName} ${vmdkFileName}`)
await exec(
`rm -f ${vmdkFileName} && python /usr/lib/python3/dist-packages/VMDKstream.py ${rawFileName} ${vmdkFileName}`
)
const ovaName = `test.ova`
await exec(`tar cf ${ovaName} ${ovfName} ${vmdkFileName}`)
const vmdkParsableFile = new NodeParsableFile(vmdkFileName, (await stat(vmdkFileName)).size)

View File

@@ -53,7 +53,9 @@ test('VMDKDirectParser reads OK', async () => {
const rawFileName = 'random-data'
const fileName = 'random-data.vmdk'
await exec('base64 /dev/urandom | head -c 104448 > ' + rawFileName)
await exec('rm -f ' + fileName + '&& python /usr/share/pyshared/VMDKstream.py ' + rawFileName + ' ' + fileName)
await exec(
'rm -f ' + fileName + '&& python /usr/lib/python3/dist-packages/VMDKstream.py ' + rawFileName + ' ' + fileName
)
const data = await readVmdkGrainTable(createFileAccessor(fileName))
const parser = new VMDKDirectParser(
createReadStream(fileName),

View File

@@ -68,7 +68,7 @@ test('VMDK to VHD can convert a random data file with VMDKDirectParser', async (
const dataSize = 100 * 1024 * 1024 // this number is an integer head/cylinder/count equation solution
try {
await execa('base64 /dev/urandom | head -c ' + dataSize + ' > ' + inputRawFileName, [], { shell: true })
await execa('python /usr/share/pyshared/VMDKstream.py ' + inputRawFileName + ' ' + vmdkFileName, [], {
await execa('python /usr/lib/python3/dist-packages/VMDKstream.py ' + inputRawFileName + ' ' + vmdkFileName, [], {
shell: true,
})
const result = await readVmdkGrainTable(createFileAccessor(vmdkFileName))