From b52791528ece6c019ad9a06171b53da8ac71f07b Mon Sep 17 00:00:00 2001 From: SohamM-Ibm <119834001+SohamM-Ibm@users.noreply.github.com> Date: Tue, 11 Jul 2023 12:45:49 +0530 Subject: [PATCH] uraimo runon arch --- .github/workflows/try.yml | 72 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/try.yml diff --git a/.github/workflows/try.yml b/.github/workflows/try.yml new file mode 100644 index 000000000000..7f3e8ee406a5 --- /dev/null +++ b/.github/workflows/try.yml @@ -0,0 +1,72 @@ +on: [push, pull_request] + +jobs: + build_job: + # The host should always be linux + runs-on: ubuntu-22.04 + name: Build on ${{ matrix.distro }} ${{ matrix.arch }} + + # Run steps on a matrix of 4 arch/distro combinations + strategy: + matrix: + include: + - arch: s390x + distro: ubuntu:22.04 + steps: + - uses: actions/checkout@v3 + - uses: uraimo/run-on-arch-action@v2 + name: Build artifact + id: build + with: + arch: ${{ matrix.arch }} + distro: ${{ matrix.distro }} + + # Not required, but speeds up builds + githubToken: ${{ github.token }} + + # Create an artifacts directory + setup: | + mkdir -p "${PWD}/artifacts" + + # Mount the artifacts directory as /artifacts in the container + dockerRunArgs: | + --volume "${PWD}/artifacts:/artifacts" + + # Pass some environment variables to the container + env: | # YAML, but pipe character is necessary + artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }} + + # The shell to run commands with in the container + shell: /bin/sh + + # Install some dependencies in the container. This speeds up builds if + # you are also using githubToken. Any dependencies installed here will + # be part of the container image that gets cached, so subsequent + # builds don't have to re-install them. The image layer is cached + # publicly in your project's package repository, so it is vital that + # no secrets are present in the container state or logs. + install: | + case "${{ matrix.distro }}" in + ubuntu*|jessie|stretch|buster|bullseye) + apt-get update -q -y + apt-get install -q -y git make wget tar curl gcc g++ + apt-get install -q -y openjdk-11-jd k&& export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") && export PATH=$JAVA_HOME/bin:$PATH + git clone https://github.com/openssl/openssl.git && cd openssl && git checkout openssl-3.0.7 && ./config --prefix=/usr --openssldir=/usr/local/openssl shared && make -j 4 && sudo make install + wget https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.12-bin.tar.gz && tar -xzf apache-ant-1.10.12-bin.tar.gz && export ANT_HOME=/home/test/apache-ant-1.10.12 && export PATH=$PATH:$ANT_HOME/bin + git clone https://github.com/apache/tomcat.git && cd tomcat && git checkout 10.10.2 && cp build.properties.default build.properties + ant + ant test + + ;; + esac + + # Produce a binary artifact and place it in the mounted volume + run: | + cp $(which git) "/artifacts/${artifact_name}" + echo "Produced artifact at /artifacts/${artifact_name}" + + - name: Show the artifact + # Items placed in /artifacts in the container will be in + # ${PWD}/artifacts on the host. + run: | + ls -al "${PWD}/artifacts"