Skip to content

Try to use setup-moonbit action to build on Ubuntu, macOS and Windows #90

Try to use setup-moonbit action to build on Ubuntu, macOS and Windows

Try to use setup-moonbit action to build on Ubuntu, macOS and Windows #90

Workflow file for this run

name: check
on:
push:
branches:
- main
pull_request:
jobs:
cla-check:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
outputs:
cla-signed: ${{ steps.cla-check-step.outputs.cla-signed }}
steps:
- name: CLA check
id: cla-check-step
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_AUTHOR=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }} \
| jq -r '.user.login')
echo "The PR author is $PR_AUTHOR"
CLA_RESPONSE=$(curl -s "https://mooncakes.io/api/v0/cla/check?gh_username=$PR_AUTHOR")
echo "CLA check response: $CLA_RESPONSE"
SIGNED=$(echo $CLA_RESPONSE | jq -r '.signed')
echo "cla-signed=$SIGNED" >> $GITHUB_ENV
echo "If you have any questions about the CLA result, please contact us."
if [ "$SIGNED" != "true" ]; then
echo "CLA is not signed."
exit 1
else
echo "CLA is signed."
fi
build:
strategy:
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
name: Build on ${{matrix.os}}
steps:
- uses: actions/[email protected]
- uses: hustcer/[email protected]
- name: moon check
run: moon check
- name: moon test
run: moon test
- name: moon bundle
run: moon bundle
- name: format diff
run: |
moon fmt
git diff
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