diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..3d955919 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + branches: + - "feature/lab3" + workflow_dispatch: + +jobs: + basic: + name: Basic CI info + system details + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Print workflow/run context + run: | + echo "Event: ${{ github.event_name }}" + echo "Repository: ${{ github.repository }}" + echo "Actor: ${{ github.actor }}" + echo "Ref: ${{ github.ref }}" + echo "SHA: ${{ github.sha }}" + echo "Run ID: ${{ github.run_id }}" + echo "Run number: ${{ github.run_number }}" + echo "Runner OS: ${{ runner.os }}" + echo "Runner Arch: ${{ runner.arch }}" + echo "Runner Name: ${{ runner.name }}" + + - name: System information (OS/CPU/RAM/Disk) + shell: bash + run: | + set -euxo pipefail + echo "=== OS Release ===" + cat /etc/os-release || true + + echo "=== Kernel ===" + uname -a + + echo "=== CPU ===" + lscpu || true + + echo "=== Memory ===" + free -h || true + + echo "=== Disk ===" + df -h || true + + echo "=== Top processes (optional) ===" + ps aux --sort=-%mem | head -n 10 || true \ No newline at end of file diff --git a/labs/submission3.md b/labs/submission3.md new file mode 100644 index 00000000..e84d8dfc --- /dev/null +++ b/labs/submission3.md @@ -0,0 +1,43 @@ +# Lab 3 — CI/CD with GitHub Actions + +## Task 1 — First GitHub Actions Workflow + +Key concepts observed: +- **Workflow**: YAML automation stored in `.github/workflows/`. +- **Trigger (event)**: `push` automatically starts a run when commits are pushed. +- **Job**: A group of steps executed on the same runner VM. +- **Steps**: Individual commands/actions executed sequentially. +- **Runner**: The machine executing the job (GitHub-hosted runner via `runs-on`). + + + + +## Task 2 — Manual Trigger + System Information + + +### `.github/workflows/lab3-ci.yml`: + +- Initial setup +- Manual trigger +- System information collection + +### Gathered System Information from Runner + +- Operating System: Ubuntu (ubuntu-latest GitHub-hosted runner) +- Kernel Version: Linux kernel version displayed via `uname -a` +- CPU Architecture: x86_64 +- Memory: RAM size and usage displayed via free `-h` +- Disk Space: Available and used storage displayed via `df -h` + +### Comparison of Manual vs Automatic Workflow Triggers + +**Automatic Trigger**: +- Activated automatically when code is pushed to the repository. +- Event type shown in logs as: `push`. +- Used for continuous integration to validate changes immediately after commit. +- Ensures automated testing and validation without manual intervention. + + +**Manual Trigger (`workflow_dispatch`)**: +- Triggered manually via GitHub UI +- Event type shown in logs as: `workflow_dispatch`.