chore: upgrade ts-client to v4. #15
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: Test Environment Sync | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| environment_name: | |
| description: 'The name of the environment to sync to' | |
| required: true | |
| default: 'staging' | |
| source: | |
| description: 'The name of the source environment' | |
| required: true | |
| default: 'production' | |
| type: | |
| description: 'The type of data to sync' | |
| required: true | |
| default: 'filesystem' | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| unit-tests: | |
| name: Run unit tests with mock API | |
| runs-on: ubuntu-latest | |
| services: | |
| mock-api: | |
| image: ghcr.io/quantcdn/quant-mock-api:4.0.0 | |
| ports: | |
| - 4010:4010 | |
| options: >- | |
| --health-cmd "nc -z 127.0.0.1 4010" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run unit tests | |
| run: npm test | |
| gha-action-test: | |
| name: Test GitHub Action with mock API | |
| runs-on: ubuntu-latest | |
| services: | |
| mock-api: | |
| image: ghcr.io/quantcdn/quant-mock-api:4.0.0 | |
| ports: | |
| - 4010:4010 | |
| options: >- | |
| --health-cmd "nc -z 127.0.0.1 4010" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Test action with mock API | |
| uses: ./ | |
| id: sync-environment | |
| with: | |
| api_key: test-api-key | |
| environment_name: test-target | |
| source: test-source | |
| app_name: test-app | |
| organization: test-org | |
| type: database | |
| base_url: http://localhost:4010 | |
| # Mock API cannot handle the wait function. | |
| # wait: true | |
| # max_retries: 3 | |
| # wait_interval: 2 | |
| - name: Debug Outputs | |
| run: | | |
| echo "Sync Success: ${{ steps.sync-environment.outputs.success }}" | |
| echo "Sync ID: ${{ steps.sync-environment.outputs.sync_id }}" |