Skip to content

Commit

Permalink
Run release and test workflow in unique dir based on SHA (#159)
Browse files Browse the repository at this point in the history
Signed-off-by: Sanjula Ganepola <Sanjula.Ganepola@ibm.com>
  • Loading branch information
SanjulaGanepola authored Oct 3, 2024
1 parent e7be859 commit 656abb1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
types: [created]

env:
remote_build_dir: /home/${{ secrets.IBMI_USER }}/build/${{ github.sha }}/
remote_home_dir: /home/${{ secrets.IBMI_USER }}/
remote_build_dir: /home/${{ secrets.IBMI_USER }}/manzan/release/${{ github.sha }}/
jar_file: manzan-installer-${{ github.ref_name }}.jar
BUILDLIB: MANZAN

Expand Down Expand Up @@ -47,6 +48,9 @@ jobs:
- name: Build on IBM i
run: |
ici \
--rcwd "${{ env.remote_home_dir }}" \
--ignore --cmd "rm -rf ${{ env.remote_build_dir }}" \
--cmd "mkdir -p ${{ env.remote_build_dir }}" \
--rcwd "${{ env.remote_build_dir }}" \
--push "." \
--cmd "/QOpenSys/pkgs/bin/gmake --jobs=1 ${{ env.jar_file }}" \
Expand All @@ -63,7 +67,8 @@ jobs:
ici \
--rcwd "${{ env.remote_build_dir }}" \
--cmd "/QOpenSys/pkgs/bin/gmake BUILDLIB=${{ env.BUILDLIB }} uninstall"
--ignore --cmd "rm -fr ${{ env.remote_build_dir }}"
--rcwd "${{ env.remote_home_dir }}" \
--cmd "rm -fr ${{ env.remote_build_dir }}"
env:
IBMI_HOST: ${{ secrets.IBMI_HOST }}
IBMI_USER: ${{ secrets.IBMI_USER }}
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
branches: [ "main" ]

env:
remote_build_dir: /home/${{ secrets.IBMI_USER }}/testbuild/
remote_home_dir: /home/${{ secrets.IBMI_USER }}/
remote_build_dir: /home/${{ secrets.IBMI_USER }}/manzan/test/${{ github.sha }}/
BUILDLIB: MZNTEST

jobs:
Expand Down Expand Up @@ -41,6 +42,9 @@ jobs:
- name: Install Manzan
run: |
ici \
--rcwd "${{ env.remote_home_dir }}" \
--ignore --cmd "rm -rf ${{ env.remote_build_dir }}" \
--cmd "mkdir -p ${{ env.remote_build_dir }}" \
--rcwd "${{ env.remote_build_dir }}" \
--push "." \
--cmd "/QOpenSys/pkgs/bin/gmake BUILDLIB=${{ env.BUILDLIB }} install" \
Expand Down Expand Up @@ -72,6 +76,8 @@ jobs:
ici \
--rcwd "${{ env.remote_build_dir }}" \
--cmd "/QOpenSys/pkgs/bin/gmake BUILDLIB=${{ env.BUILDLIB }} uninstall" \
--rcwd "${{ env.remote_home_dir }}" \
--cmd "rm -rf ${{ env.remote_build_dir }}" \
env:
IBMI_HOST: ${{ secrets.IBMI_HOST }}
IBMI_USER: ${{ secrets.IBMI_USER }}
Expand Down

0 comments on commit 656abb1

Please sign in to comment.