check #65
This file contains hidden or 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: check | |
| on: | |
| schedule: | |
| # Runs at 02:30, only on Friday. | |
| # https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule | |
| - cron: "30 2 * * 5" | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| pull_request: | |
| jobs: | |
| check: | |
| strategy: | |
| matrix: | |
| version: [stable,pre-release,bleeding] | |
| os: | |
| - name: ubuntu-latest | |
| triple: x86_64-linux-gnu | |
| - name: macos-latest | |
| triple: arm64-apple-darwin | |
| - name: macos-13 | |
| triple: x86_64-apple-darwin | |
| - name: windows-latest | |
| triple: x86_64-w64-mingw32 | |
| # stable check | |
| # pre-release check | |
| # bleeding check | |
| # 1. install latest toolchain | |
| # 2. install latest core library from github.com | |
| fail-fast: false | |
| runs-on: ${{ matrix.os.name }} | |
| continue-on-error: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup Moon | |
| uses: illusory0x0/setup-moonbit@v0.1.0 | |
| with: | |
| version: ${{ matrix.version }} | |
| - name: moon version | |
| run: | | |
| moon version --all | |
| - name: install module dependencies | |
| run: | | |
| moon update | |
| moon check --deny-warn | |
| - name: moon check | |
| run: moon check --deny-warn | |
| - name: moon info | |
| run: | | |
| moon info --target wasm,wasm-gc,js,native | |
| git diff --exit-code | |
| - name: format diff | |
| run: | | |
| moon fmt | |
| git diff --exit-code | |
| - name: Setup MSVC | |
| if: ${{ matrix.os.name == 'windows-latest' }} | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Set ulimit on unix | |
| if: ${{ matrix.os.name != 'windows-latest' }} | |
| run: | | |
| ulimit -s 8176 | |
| - name: moon test | |
| run: | | |
| moon test --target all,native | |
| moon test --target all,native --release | |
| - name: moon test --doc | |
| run: | | |
| moon test --doc | |
| moon-json-format-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: check `moon.*.json` format | |
| shell: bash | |
| run: | | |
| _passed=0; | |
| for f in $(find . -type f -name "moon.*.json"); do | |
| if ! jq '.' $f > /dev/null; then | |
| echo $f; | |
| _passed=1; | |
| fi | |
| done | |
| (exit $_passed) | |
| prettier: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| - run: | | |
| npm install --global prettier; | |
| find . -name *.mod.json -exec npx prettier --write {} \; | |
| find . -name *.pkg.json -exec npx prettier --write {} \; | |
| git diff --exit-code; | |
| check-typos: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: AutoCorrect | |
| uses: huacnlee/autocorrect-action@v2 | |
| - name: typos-action | |
| uses: crate-ci/typos@v1.31.1 |