-
-
Notifications
You must be signed in to change notification settings - Fork 18
45 lines (35 loc) · 1.17 KB
/
twitter.yaml
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
name: Twitter Behavior
on:
push:
pull_request:
schedule:
- cron: '10 16 * * *'
jobs:
twitter_test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: install requirements
run: yarn install
- uses: c-py/action-dotenv-to-setenv@v2
with:
env-file: test/test.env
- name: get browsertrix image
run: docker pull $BROWSERTRIX_IMAGE
- name: run crawl
run: docker run -v $PWD/dist/behaviors.js:/app/node_modules/browsertrix-behaviors/dist/behaviors.js $BROWSERTRIX_IMAGE crawl --url https://twitter.com/CaptureSample --limit 1 --logging behaviors > ./log
- name: cat log
run: cat ./log
- uses: sergeysova/jq-action@v2
name: compare crawl log to expected
with:
cmd: cat log
| jq -Rr -c 'fromjson? | .details | select(type == "object") | {msg,state} | select(.msg != null) | select(.msg | contains("?cxt") | not)'
| diff - ./test/expected-twitter.log