Skip to content

Execute nightly tests #527

Execute nightly tests

Execute nightly tests #527

Workflow file for this run

name: Execute nightly tests
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 1-5'
repository_dispatch:
types: [automation-tests-event]
jobs:
run-functional-tests:
if: ${{ github.event_name != 'repository_dispatch' }}
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Prepare saleor CLI
run: pnpm build
- name: Write config file
id: write-config-file
env:
CLI_ACCESS_TOKEN: ${{ secrets.CLI_ACCESS_TOKEN }}
CLI_GITHUB_TOKEN: ${{ secrets.CLI_GITHUB_TOKEN }}
CLI_VERCEL_TOKEN: ${{ secrets.CLI_VERCEL_TOKEN }}
TEST_COMMAND: 'node dist/saleor.js'
run: echo '{"token":"${{ secrets.CLI_ACCESS_TOKEN }}","telemetry":"false","saleor_env":"staging","cloud_api_url":"https://staging-cloud.saleor.io/platform/api", "github_token":"${{ secrets.CLI_GITHUB_TOKEN }}", "vercel_token":"${{ secrets.CLI_VERCEL_TOKEN }}" }' > ~/.config/saleor.json
- name: pre run
env:
SALEOR_CLI_ENV: staging
RUN_FUNCTIONAL_TESTS: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
node dist/saleor.js info
node dist/saleor.js status
- name: clear cloud projects
env:
SALEOR_CLI_ENV: staging
RUN_FUNCTIONAL_TESTS: true
run: |
pnpm vitest run test/clear_cloud.test.ts
- name: run tests
env:
RUN_FUNCTIONAL_TESTS: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git config --global user.name 'GA-saleor-cli'
git config --global user.email '[email protected]'
pnpm vitest test/functional -t '^((?!(deploy|tunnel)).)*$' --no-threads
- name: Notify Slack
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_SNAP_RESTORE }}
SLACK_USERNAME: FunctionalTestsBot
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: "Functional tests failed"
SLACK_MESSAGE: "https://github.com/saleor/saleor-cli/actions/workflows/tests-nightly.yml"
MSG_MINIMAL: true