-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix various issues with build process build
- Loading branch information
Showing
4 changed files
with
61 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,78 +11,27 @@ on: | |
types: [ created ] | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' }} | ||
|
||
jobs: | ||
|
||
build_sirius: | ||
name: build sirius | ||
runs-on: ubuntu-latest | ||
container: 'centos:centos7' | ||
steps: | ||
- name: is release created | ||
- name: Build sirius using docker image | ||
run: | | ||
release_created=${{ github.event_name == 'release' && github.event.action == 'created' }} | ||
echo "RELEASE_CREATED=$release_created" >> $GITHUB_ENV | ||
docker build -t centos7-sirius -f docker/Dockerfile | ||
- name: Get release | ||
if: ${{ env.RELEASE_CREATED == 'true' }} | ||
id: get_release | ||
uses: | ||
bruceadams/[email protected] | ||
|
||
- name: install requirements | ||
run: | | ||
yum install -y epel-release | ||
yum install -y git redhat-lsb-core centos-release-scl scl-utils | ||
yum install -y cmake3 devtoolset-9 | ||
- name: Checkout sirius | ||
run: | | ||
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git -b $GITHUB_REF_NAME . | ||
- name: set sirius output variables | ||
id: sirius-variables | ||
run: | | ||
SIRIUS_BASE_PATH=$PWD | ||
SIRIUS_INSTALL_DIR=centos-7_sirius-solver-install | ||
SIRIUS_INSTALL_PATH="${SIRIUS_BASE_PATH}/${SIRIUS_INSTALL_DIR}" | ||
ARCHIVE_NAME=centos-7_sirius-solver.zip | ||
ARCHIVE_PATH="${SIRIUS_BASE_PATH}/${ARCHIVE_NAME}" | ||
echo "::set-output name=install-dir::$SIRIUS_INSTALL_DIR" | ||
echo "::set-output name=install-path::$SIRIUS_INSTALL_PATH" | ||
echo "::set-output name=archive-name::$ARCHIVE_NAME" | ||
echo "::set-output name=archive-path::$ARCHIVE_PATH" | ||
- name: Configure Sirius | ||
run: | | ||
source /opt/rh/devtoolset-9/enable | ||
cmake3 -S src \ | ||
-B build \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX="${{ steps.sirius-variables.outputs.install-dir }}" | ||
- name: Build & Install Sirius | ||
- name: create a container without starting it && retrieve the .tgz | ||
run: | | ||
source /opt/rh/devtoolset-9/enable | ||
cmake3 --build build --config Release --target install -j14 | ||
- name: Zip Install Sirius | ||
container_id=$(docker create centos7-sirius) | ||
docker cp $container_id:/centos-7_sirius-solver.zip /tmp | ||
- name: Publish assets | ||
if: ${{ env.IS_RELEASE == 'true' }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
tag: ${{ github.event.inputs.release_tag }} | ||
run: | | ||
ARCHIVE_NAME="${{ steps.sirius-variables.outputs.archive-name }}" | ||
zip -r $ARCHIVE_NAME "${{ steps.sirius-variables.outputs.install-dir }}" | ||
- name: Upload sirius install | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ steps.sirius-variables.outputs.install-dir }} | ||
path: ${{ steps.sirius-variables.outputs.install-path }} | ||
|
||
- name: Publish sirius install | ||
if: ${{ env.RELEASE_CREATED == 'true' }} | ||
uses: actions/[email protected] | ||
with: | ||
upload_url: ${{ steps.get_release.outputs.upload_url }} | ||
asset_path: ${{ steps.sirius-variables.outputs.archive-path }} | ||
asset_name: ${{ steps.sirius-variables.outputs.archive-name }} | ||
asset_content_type: application/zip | ||
gh release upload "$tag" /tmp/centos-7_sirius-solver.zip |
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
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,44 @@ | ||
FROM centos:7 | ||
|
||
ENV LANG=en_US.UTF-8 \ | ||
LC_ALL=en_US.UTF-8 | ||
|
||
CMD ["/bin/bash"] | ||
|
||
# Install requirements : update repo | ||
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo &&\ | ||
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo &&\ | ||
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo &&\ | ||
yum install -y epel-release &&\ | ||
yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils python3 &&\ | ||
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo &&\ | ||
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo &&\ | ||
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo | ||
|
||
RUN yum update -y | ||
RUN yum install -y epel-release | ||
RUN yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils rpm-build && \ | ||
yum install -y devtoolset-9 && \ | ||
yum install -y rh-git227-git cmake3 | ||
|
||
RUN rm -rf /var/cache/yum | ||
|
||
RUN echo "source /opt/rh/devtoolset-9/enable" >> /etc/bashrc | ||
RUN echo "source /opt/rh/rh-git227/enable" >> /etc/bashrc | ||
|
||
SHELL ["/bin/bash", "--login", "-c"] | ||
|
||
RUN git clone --branch antares_integration --depth 1 https://github.com/rte-france/sirius-solver | ||
|
||
RUN cd sirius-solver &&\ | ||
cmake3 -S src \ | ||
-B build \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX="/install" | ||
|
||
RUN cd sirius-solver &&\ | ||
cmake3 --build build --config Release -j4 &&\ | ||
cd build &&\ | ||
cmake3 --install . | ||
|
||
RUN zip -r /centos-7_sirius-solver.zip /install |