Skip to content

Commit

Permalink
ci/x86_64: run workflow directly inside the Docker container
Browse files Browse the repository at this point in the history
Signed-off-by: Bindea Cristian <[email protected]>
  • Loading branch information
bindea-cristian committed Aug 29, 2024
1 parent c054f51 commit a19a0c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
19 changes: 5 additions & 14 deletions .github/workflows/appimage-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,22 @@ jobs:

build_scopy_x86-64_appimage:
runs-on: ubuntu-20.04
container:
image: cristianbindea/scopy2-x86_64-appimage:testing
options: --user root

steps:
- uses: actions/checkout@v4
with:
set-safe-directory: 'true'

- name: Pull the Docker Image
run: docker pull cristianbindea/scopy2-x86_64-appimage:testing

- name: Create Scopy AppImage
shell: bash
run: |
export CI_SCRIPT=ON
cd $GITHUB_WORKSPACE
./ci/x86_64/x86-64_appimage_process.sh generate_ci_envs
docker run \
--mount type=bind,source="$GITHUB_WORKSPACE",target=/home/runner/scopy \
--env-file $GITHUB_WORKSPACE/ci/x86_64/gh-actions.envs \
cristianbindea/scopy2-x86_64-appimage:testing \
/bin/bash -c 'cd $HOME && \
sudo chown -R runner:runner scopy && \
cd $HOME/scopy && \
./ci/x86_64/x86-64_appimage_process.sh run_workflow
'
./ci/x86_64/x86-64_appimage_process.sh run_workflow
- name: Set short git commit SHA
shell: bash
run: echo "commit_sha=$(git rev-parse --short ${{ github.sha }})" >> "$GITHUB_ENV"
Expand Down
18 changes: 8 additions & 10 deletions ci/x86_64/x86-64_appimage_process.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ set -ex
USE_STAGING=OFF
##

if [ "$CI_SCRIPT" == "ON" ]
then
SRC_DIR=/home/runner/scopy
SRC_SCRIPT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
git config --global --add safe.directory '*'
USE_STAGING=OFF
else
SRC_DIR=$(git rev-parse --show-toplevel 2>/dev/null ) || echo "No source directory found"
SRC_SCRIPT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SRC_DIR=$(git rev-parse --show-toplevel 2>/dev/null ) || echo "No source directory found"
SRC_SCRIPT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

if [ "$CI_SCRIPT" == "ON" ]; then
USE_STAGING=OFF
SRC_DIR=$GITHUB_WORKSPACE
fi


export APPIMAGE=1

LIBIIO_VERSION=libiio-v0
Expand Down Expand Up @@ -423,7 +421,7 @@ create_appimage(){
}

generate_ci_envs(){
$GITHUB_WORKSPACE/ci/general/gen_ci_envs.sh > $GITHUB_WORKSPACE/ci/x86_64/gh-actions.envs
$SRC_DIR/ci/general/gen_ci_envs.sh > $SRC_DIR/ci/x86_64/gh-actions.envs
}

move_appimage(){
Expand Down

0 comments on commit a19a0c8

Please sign in to comment.