-
-
Notifications
You must be signed in to change notification settings - Fork 19
83 lines (79 loc) · 2.65 KB
/
integration-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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.73.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 }}