ci: fix autotest LFC ci #2
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: LFC Script CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: ["*"] | |
| jobs: | |
| test_lfc_script: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Make LFC.sh executable | |
| run: chmod +x LFC/LFC.sh | |
| - name: Run LFC.sh and verify output | |
| run: | | |
| set -e | |
| OUTPUT_DIR="/tmp/lfc_output" | |
| TARBALL="/tmp/lfc_output.tar.gz" | |
| EXTRACT_DIR="/tmp/extracted_output" | |
| echo "--- Running LFC.sh ---" | |
| sudo ./LFC/LFC.sh "$OUTPUT_DIR" | |
| echo "--- Creating tarball ---" | |
| tar -czf "$TARBALL" -C "$(dirname "$OUTPUT_DIR")" "$(basename "$OUTPUT_DIR")" | |
| echo "--- Extracting tarball ---" | |
| mkdir -p "$EXTRACT_DIR" | |
| tar -xzf "$TARBALL" -C "$EXTRACT_DIR" | |
| LOG_FILE_PATH="$EXTRACT_DIR/$(basename "$OUTPUT_DIR")/log_file.log" | |
| if [ -f "$LOG_FILE_PATH" ]; then | |
| echo "log_file.log found." | |
| if grep -q "Artifact collection completed" "$LOG_FILE_PATH"; then | |
| echo "Artifact collection completed message found in log." | |
| else | |
| echo "Error: Artifact collection completed message NOT found in log." | |
| cat "$LOG_FILE_PATH" | |
| exit 1 | |
| fi | |
| else | |
| echo "Error: log_file.log not found." | |
| ls -R "$EXTRACT_DIR" | |
| exit 1 | |
| fi |