diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..465651597 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,20 @@ +# Pull Request + +## Goal + + +## Changes + + +## Testing + + +## Artifacts & Screenshots + + +--- + +## Checklist +- [ ] Title is clear (`feat(labN): ` style) +- [ ] No secrets/large temp files committed +- [ ] Submission file at `submissions/labN.md` exists diff --git a/.github/workflows/lab1-smoke.yml b/.github/workflows/lab1-smoke.yml new file mode 100644 index 000000000..44c8c86e3 --- /dev/null +++ b/.github/workflows/lab1-smoke.yml @@ -0,0 +1,34 @@ +name: Smoke Test Juice Shop + +on: + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + smoke-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run Juice Shop + run: docker run -d --name juice-shop -p 3000:3000 bkimminich/juice-shop:v20.0.0 + + - name: Wait for ready + run: | + for i in $(seq 1 30); do + curl --silent --fail http://localhost:3000/rest/admin/application-version && exit 0 + sleep 2 + done + exit 1 + + - name: Check homepage + run: | + [ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:3000)" = "200" ] + + - name: Check API + run: | + curl -s http://localhost:3000/api/Products | jq '.data | length' | grep -q . diff --git a/submissions/lab1.md b/submissions/lab1.md new file mode 100644 index 000000000..b8b50c208 --- /dev/null +++ b/submissions/lab1.md @@ -0,0 +1,6 @@ + +## Bonus: CI Smoke Test + +- Workflow file: `.github/workflows/lab1-smoke.yml` +- Trigger: pull_request on main +- Run URL: (will appear after PR)