-
Notifications
You must be signed in to change notification settings - Fork 5.7k
61 lines (54 loc) · 1.46 KB
/
commit-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
name: tests
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
actions: read
jobs:
relevant-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Ivy 🛎
uses: actions/checkout@v3
with:
path: ivy
persist-credentials: false
fetch-depth: 100
- name: Fetch Commit Changes
id: fetch_changes
run: |
cd ivy
if [ "${{ github.event_name }}" == "pull_request" ]; then
git fetch origin main
git diff origin/main HEAD --output="commit-diff.txt"
else
git diff HEAD^ HEAD --output="commit-diff.txt"
fi
- name: Install ivy and fetch binaries
run: |
cd ivy
sudo pip3 install -e .
mkdir .ivy
touch .ivy/key.pem
echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem
cd ..
- name: Get Job URL
uses: Tiryoh/gha-jobid-action@v0
id: jobs
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: ${{ github.job }}
- name: Run Tests
id: tests
run: |
pip3 install pymongo
cd ivy
docker run --rm -v "$(pwd)":/ivy -v "$(pwd)"/.hypothesis:/.hypothesis ivyllc/ivy:latest python3 scripts/run_tests_from_diff.py
continue-on-error: true
- name: Check on failures
if: steps.tests.outcome != 'success'
run: exit 1