Moon bit test agent #54
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: coverage_and_test | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v4 | |
- 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" | |
- 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 | |