-
Notifications
You must be signed in to change notification settings - Fork 90
98 lines (71 loc) · 2.52 KB
/
coverage_and_test.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: coverage_and_test
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install -r scripts/requirements.txt
- name: install
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: initial moon test
run: moon test --enable-coverage
- name: initial coverage report
run: |
moon coverage report -f summary > coverage_summary.txt
cat coverage_summary.txt >> "$GITHUB_STEP_SUMMARY"
moon coverage report -f coveralls
- name: coverage improvement
run: python scripts/testagent.py
- name: Get code changes
run: |
git diff > changes.txt
test_code=$(cat changes.txt)
echo "::set-output name=test_code::$test_code"
- name: push comments
uses: peter-evans/create-or-update-comment@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit-sha: ${{ github.event.pull_request.head.sha }}
body: |
Here are the test code changes:
```
${{ steps.get_code_changes.outputs.test_code }}
```
reaction-type: rocket
typo-check:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
FORCE_COLOR: 1
TYPOS_VERSION: v1.19.0
steps:
- name: download typos
run: curl -LsSf https://github.com/crate-ci/typos/releases/download/$TYPOS_VERSION/typos-$TYPOS_VERSION-x86_64-unknown-linux-musl.tar.gz | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: check typos
run: typos
license-header-check:
runs-on: ubuntu-latest
env:
HAWKEYE_VERSION: v5.5.1
steps:
- uses: actions/checkout@v4
- name: Download HawkEye
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/korandoru/hawkeye/releases/download/$HAWKEYE_VERSION/hawkeye-installer.sh | sh
- name: Check License Header
run: hawkeye check