Skip to content

only test user and group schema and resourcetype when they are enabled through the config #120

only test user and group schema and resourcetype when they are enabled through the config

only test user and group schema and resourcetype when they are enabled through the config #120

Workflow file for this run

name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install dependencies
run: npm install
- name: Build Docker image
run: docker build -t ghcr.io/limosa-io/scimverify:latest .
- name: Test against Laravel SCIM Server
run: |
# Start the Laravel SCIM server in the background
docker run -d -p 8000:8000 --name laravel-scim-server ghcr.io/limosa-io/laravel-scim-server:latest
# Wait for server to be ready
timeout 60 bash -c 'until curl -f http://localhost:8000/scim/v2/Schemas; do sleep 2; done'
sed -i 's/requireAuthentication: true/requireAuthentication: false/' ./site/.vitepress/theme/components/config.yaml
# Run scimverify tests against the server
npx node ./bin/scimverify.js --config ./site/.vitepress/theme/components/config.yaml --base-url http://localhost:8000/scim/v2/ --auth-header "Bearer YOUR_TOKEN"
# Cleanup
docker stop laravel-scim-server
docker rm laravel-scim-server
deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install dependencies
run: cd ./site/ && npm install
- name: Build site
run: cd ./site/ && npm run build
env:
VITE_SCIM_TEST_SERVER_URL: ${{ secrets.VITE_SCIM_TEST_SERVER_URL }}
VITE_TURNSTILE_SITE_KEY: ${{ secrets.VITE_TURNSTILE_SITE_KEY }}
- name: Install Netlify CLI
run: npm install -g netlify-cli
- name: Deploy to Netlify
run: netlify deploy --prod --dir=./site/.vitepress/dist
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Push to dokku
uses: dokku/github-action@master
with:
git_remote_url: "ssh://[email protected]:22/verify"
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
git_push_flags: '--force'
- name: Build image
run: docker build -t ghcr.io/limosa-io/scimverify:latest .
- name: Authenticate to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Push image
run: docker push ghcr.io/${{ github.repository }}:latest
release:
name: Release
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org/'
- name: Install dependencies
run: npm install
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}