Skip to content

Daily Integration Tests #891

Daily Integration Tests

Daily Integration Tests #891

name: Daily Integration Tests
on:
schedule:
- cron: 0 10 * * *
workflow_dispatch:
issue_comment:
types: [ created ]
jobs:
Check-Comments:
name: Check for comments
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.sha.outputs.result }}
steps:
- name: Get PR SHA
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/test' }}
id: sha
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const { owner, repo, number } = context.issue;
const pr = await github.rest.pulls.get({
owner,
repo,
pull_number: number,
});
return pr.data.head.sha
- name: Post comment
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/test' }}
uses: actions/github-script@v6
with:
script: |
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Tests are running at https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
})
Check-For-Changes:
name: Check for changes
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.commits.outputs.changes }}
steps:
- uses: actions/checkout@v3
- name: Check for commits
if: ${{ github.event.schedule }}
run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_ENV
- id: commits
if: ${{ github.event.schedule }}
run: echo "changes=$NEW_COMMIT_COUNT" >> "$GITHUB_OUTPUT"
Integration-Test:
name: ${{ matrix.version }} - Integration Tests
runs-on: macos-latest
needs: [ Check-Comments, Check-For-Changes ]
if: ${{ needs.Check-For-Changes.outputs.changes > 0 || needs.Check-Comments.outputs.sha || github.event_name == 'workflow_dispatch' }}
strategy:
fail-fast: false
matrix:
version: [ 1.56.0, latest, insider ]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ needs.Check-Comments.outputs.sha || github.sha }}
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install dependencies and requirements
run: |
npm ci
npm i titanium alloy -g
ti sdk install latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Integration Tests
run: npm run test:integration
env:
CODE_STREAM: ${{ matrix.version }}