Small changes #11
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| specs: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| crystal: [1.15.0] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up tree-sitter | |
| uses: tree-sitter/setup-action/cli@v1 | |
| with: | |
| tree-sitter-ref: latest | |
| - name: Build tree-sitter shared library | |
| run: | | |
| git clone https://github.com/tree-sitter/tree-sitter.git | |
| cd tree-sitter | |
| make | |
| sudo make install | |
| - name: Build tree-sitter-json shared library | |
| run: | | |
| git clone https://github.com/tree-sitter/tree-sitter-json.git | |
| cd tree-sitter-json | |
| make | |
| sudo make install | |
| - name: Set up Crystal | |
| uses: crystal-lang/install-crystal@v1 | |
| with: | |
| crystal: ${{matrix.crystal}} | |
| - name: Run Crystal specs | |
| run: crystal spec -p -s | |
| lint: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| crystal: [1.15.0] | |
| ameba-version: [v1.6.4] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Crystal | |
| uses: crystal-lang/install-crystal@v1 | |
| with: | |
| crystal: ${{matrix.crystal}} | |
| - name: Cache Ameba binary | |
| id: cache-ameba | |
| uses: actions/cache@v3 | |
| with: | |
| path: bin/ameba | |
| key: ${{ matrix.os }}-ameba-${{ matrix.ameba-version }}-${{ matrix.crystal }} | |
| - name: Build Ameba | |
| if: steps.cache-ameba.outputs.cache-hit != 'true' | |
| run: | | |
| git clone --branch ${{ matrix.ameba-version }} --single-branch https://github.com/crystal-ameba/ameba.git | |
| cd ameba | |
| make bin/ameba CRFLAGS='-Dpreview_mt --release --no-debug' | |
| mkdir -p ../bin | |
| mv bin/ameba ../bin/ameba | |
| cd .. | |
| rm -rf ameba | |
| - name: Run Ameba Linter | |
| run: bin/ameba -c .ameba.yml |