Skip to content

Commit

Permalink
Merge pull request #186 from Achiefs/183-fix-centos-workflows
Browse files Browse the repository at this point in the history
Fix CentOS 7 workflow
  • Loading branch information
okynos authored Jan 19, 2025
2 parents 2f7552b + 357514c commit 9244a9f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/install-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,19 @@ jobs:

Build-install-centos:
runs-on: [self-hosted, centos7]
env:
repodir: ${{ github.workspace }}/${{ github.run_id }}
steps:
- name: Check out repository code, branch='${{ github.ref }}'
uses: actions/checkout@v2
run: git clone https://github.com/${{ github.repository }}.git -b ${{ github.ref_name }} $repodir

- name: Building package
run: sudo ./builder.sh
working-directory: ./pkg/rpm
working-directory: ${{ github.run_id }}/pkg/rpm

- name: Installing package
run: sudo yum install -y ./fim*.rpm
working-directory: ./pkg/rpm
working-directory: ${{ github.run_id }}/pkg/rpm

- name: Start FIM service
run: sudo systemctl start fim
Expand All @@ -75,6 +77,10 @@ jobs:
if: always()
run: sudo yum remove -y fim

- name: Remove repository
if: always()
run: sudo rm -rf $repodir


Build-install-macos:
runs-on: macos-latest
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/system-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,24 @@ jobs:

audit-system-tests-centos7:
runs-on: [self-hosted, centos7]
env:
repodir: ${{ github.workspace }}/${{ github.run_id }}

steps:
- name: Check out repository code, branch='${{ github.ref }}'
uses: actions/checkout@v2
run: git clone https://github.com/${{ github.repository }}.git -b ${{ github.ref_name }} $repodir

- name: Build FIM
run: /home/okynos/.cargo/bin/cargo build --release
working-directory: ${{ github.run_id }}

- name: Change configuration
run: sed -i 's|/tmp|/tmp/test|g' config/linux/config.yml
working-directory: ${{ github.run_id }}

- name: Copy FIM binary to main folder
run: cp ./target/release/fim ./
working-directory: ${{ github.run_id }}

- name: Create required directories
run: mkdir -p /tmp/test
Expand All @@ -143,16 +148,19 @@ jobs:

- name: Start FIM process
run: sudo ./fim &
working-directory: ${{ github.run_id }}

- name: Check FIM running
run: sleep 5 && ps a | grep fim | grep -v grep

- name: Launch test suite
run: sudo python3 -m pytest test/system/audit.py -v
working-directory: ${{ github.run_id }}

- name: Print config file
if: always()
run: cat ${{ github.workspace }}/config/linux/config.yml || true
run: cat ./config/linux/config.yml || true
working-directory: ${{ github.run_id }}

- name: Print log file
if: always()
Expand All @@ -176,10 +184,16 @@ jobs:

- name: Clean workspace
if: always()
run: sudo rm -rf ${{ github.workspace }}/test/system/__pycache__/ ${{ github.workspace }}/test/system/.pytest_cache ${{ github.workspace }}/.pytest_cache
run: sudo rm -rf ./test/system/__pycache__/ ./test/system/.pytest_cache ./.pytest_cache
working-directory: ${{ github.run_id }}

- name: Clean test output
if: always()
run: sudo rm -rf ${{ github.workspace }}/test_*
run: sudo rm -rf ./test_*
working-directory: ${{ github.run_id }}

- name: Remove repository
if: always()
run: sudo rm -rf $repodir

- run: echo "Job's status is ${{ job.status }}."

0 comments on commit 9244a9f

Please sign in to comment.