-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from Exabyte-io/feature/SOF-5466
Feature/sof-5466
- Loading branch information
Showing
7 changed files
with
151 additions
and
47 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,48 @@ | ||
name: Build docker containers and run tests | ||
inputs: | ||
aws-access-key-id: | ||
required: true | ||
aws-secret-access-key: | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Pull base image | ||
uses: ./actions/docker/ecr | ||
id: login-ecr | ||
with: | ||
ecr-repository: centos-7.9-base | ||
aws-access-key-id: ${{ inputs.aws-access-key-id }} | ||
aws-secret-access-key: ${{ inputs.aws-secret-access-key }} | ||
image-tag: latest | ||
action: pull | ||
|
||
- name: Build application container | ||
shell: bash -l {0} | ||
run: docker-compose build materials-designer | ||
uses: ./actions/docker/build | ||
with: | ||
image-name: materials-designer | ||
dockerfile: ./dockerfiles/app/Dockerfile | ||
cli-args: --build-arg BASE_IMAGE=${{ steps.login-ecr.outputs.registry }}/centos-7.9-base | ||
|
||
|
||
- name: Build test container | ||
shell: bash -l {0} | ||
run: docker-compose build materials-designer-test | ||
uses: ./actions/docker/build | ||
with: | ||
image-name: materials-designer-test | ||
dockerfile: ./dockerfiles/app/test/Dockerfile | ||
cli-args: --build-arg BASE_IMAGE=${{ steps.login-ecr.outputs.registry }}/centos-7.9-base | ||
|
||
|
||
- name: Run tests | ||
shell: bash -l {0} | ||
run: | | ||
docker-compose up -d materials-designer | ||
while ! docker logs materials-designer_materials-designer_1 2>&1 | grep "Compiled"; do | ||
failed=$(docker logs materials-designer_materials-designer_1 2>&1 | grep "Failed") | ||
docker run -d -p 3001:3001 --name=materials-designer materials-designer:latest | ||
while ! docker logs materials-designer 2>&1 | grep "Compiled"; do | ||
failed=$(docker logs materials-designer 2>&1 | grep "Failed") | ||
if [[ "$failed" != "" ]]; then | ||
exit 1 | ||
fi | ||
sleep 5 | ||
done | ||
docker-compose run materials-designer-test | ||
docker run --network=host materials-designer-test |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ARG BASE_IMAGE | ||
ARG IMAGE_TAG=latest | ||
FROM ${BASE_IMAGE}:${IMAGE_TAG} | ||
|
||
WORKDIR /opt/app | ||
|
||
COPY . . | ||
|
||
RUN source scl_source enable devtoolset-8 && \ | ||
npm install | ||
|
||
EXPOSE 3001 | ||
|
||
RUN bash core-js-fix.sh | ||
|
||
ENTRYPOINT ["/opt/app/entrypoint.sh"] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
ARG BASE_IMAGE | ||
ARG IMAGE_TAG=latest | ||
FROM ${BASE_IMAGE}:${IMAGE_TAG} | ||
|
||
ENV NODE_VERSION $TEST_NODE_VERSION | ||
ENV NPM_VERSION $TEST_NPM_VERSION | ||
|
||
ARG NVM=${NVM_DIR}/nvm.sh | ||
RUN . $NVM && \ | ||
nvm use v$NODE_VERSION && \ | ||
npm install -g npm@$NPM_VERSION | ||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules | ||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH | ||
|
||
WORKDIR /opt/test | ||
RUN git init | ||
COPY . . | ||
|
||
WORKDIR /opt/test/tests | ||
RUN source scl_source enable devtoolset-8 && npm install | ||
|
||
|
||
# This is an interesting hack. There is a bug in the function | ||
# to getLinuxChromeDriverArchitecture causing a comparison between | ||
# a number and a string when two strings are expected. | ||
RUN sed -i "s/if(compareVersions(version,/if(compareVersions(String(version),/" \ | ||
node_modules/selenium-standalone/lib/compute-download-urls.js | ||
|
||
|
||
# Entrypoint was previously defined in /opt/app so overwrite | ||
# it for easiest test container development and just pass along a flag | ||
# to kick off the tests instead of running the application | ||
WORKDIR /opt/test | ||
ENV BASE_DIR /opt/test | ||
ENTRYPOINT ["/opt/test/entrypoint.sh", "test"] | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.