Skip to content

Commit 60a3d5b

Browse files
committed
ci tests added
1 parent 7008d25 commit 60a3d5b

File tree

1 file changed

+45
-7
lines changed

1 file changed

+45
-7
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,53 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- main
5+
pull_request:
76

87
jobs:
9-
build:
8+
test:
109
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: "18"
23+
24+
- name: Install dependencies
25+
run: npm install
26+
27+
- name: Build image
28+
run: docker build -t scimverify-test .
29+
30+
- name: Test Docker image
31+
run: bash ./test-docker.sh
32+
33+
- name: Test against Laravel SCIM Server
34+
run: |
35+
# Start the Laravel SCIM server in the background
36+
docker run -d -p 8000:8000 --name laravel-scim-server ghcr.io/limosa-io/laravel-scim-server:latest
37+
38+
# Wait for server to be ready
39+
timeout 60 bash -c 'until curl -f http://localhost:8000/scim/v2/Schemas; do sleep 2; done'
40+
41+
# Run scimverify tests against the server
42+
npx node ./bin/scimverify.js --config ./site/.vitepress/theme/components/config.yaml --baseUrl http://localhost:8000
43+
44+
# Cleanup
45+
docker stop laravel-scim-server
46+
docker rm laravel-scim-server
47+
48+
deploy:
49+
runs-on: ubuntu-latest
50+
needs: test
51+
if: github.ref == 'refs/heads/main'
1152
permissions:
1253
contents: read
1354
packages: write
@@ -49,13 +90,10 @@ jobs:
4990
git_push_flags: '--force'
5091

5192
- name: Build image
52-
run: docker build -t scimverify-test .
93+
run: docker build -t scimverify-test .
5394

5495
- name: Authenticate to GHCR
5596
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
5697

5798
- name: Push image
5899
run: docker push ghcr.io/${{ github.repository }}:latest
59-
60-
- name: Test Docker image
61-
run: bash ./test-docker.sh

0 commit comments

Comments
 (0)