Improve strace output with better default options and detailed log he… #7
This file contains hidden or 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
| name: Test Wrapper Action | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test-basic: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Test wrapper with a simple action (no strace) | |
| uses: ./ | |
| with: | |
| action-ref: "actions/hello-world-javascript-action@main" | |
| enable-strace: "false" | |
| input-who-to-greet: "World" | |
| test-strace: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install strace and set permissions | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y strace | |
| # Set permissions to allow strace to work without privilege issues | |
| echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope || true | |
| - name: Test wrapper with strace | |
| id: strace-test | |
| uses: ./ | |
| with: | |
| action-ref: "actions/hello-world-javascript-action@main" | |
| enable-strace: "true" | |
| strace-options: "-f -v -s 256 -e trace=file,process,network,signal,ipc,desc,memory" | |
| input-who-to-greet: "Strace" | |
| - name: Check strace output | |
| run: | | |
| if [ -f "${{ steps.strace-test.outputs.strace-log }}" ]; then | |
| echo "Strace log file exists at ${{ steps.strace-test.outputs.strace-log }}" | |
| head -n 20 "${{ steps.strace-test.outputs.strace-log }}" | |
| else | |
| echo "Strace log file not found!" | |
| exit 1 | |
| fi | |
| - name: Upload strace logs as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: strace-logs | |
| path: ${{ steps.strace-test.outputs.strace-log }} |