Merge pull request #2 from coalton-lang/nonempty-string #3
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: Build/test | |
on: | |
push: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
changedfiles: | |
runs-on: ubuntu-latest | |
outputs: | |
all: ${{ steps.changes.outputs.all}} | |
c: ${{ steps.changes.outputs.c }} | |
gen: ${{ steps.changes.outputs.gen }} | |
steps: | |
- name: checkout tree-sitter-coalton | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 | |
- name: Get changed files | |
id: changes | |
run: | | |
echo "all=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)" >> $GITHUB_OUTPUT | |
echo "c=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '\.\(c\|h\)$' | xargs)" >> $GITHUB_OUTPUT | |
# Generated C code | |
echo "gen=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '\.\(c\|h\)$' | grep -v 'src/scanner.c' | xargs)" >> $GITHUB_OUTPUT | |
test: | |
runs-on: ${{ matrix.os }} | |
needs: changedfiles | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, macos-latest] # , windows-latest | |
steps: | |
- name: checkout tree-sitter-coalton | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 10 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Generate parser from scratch and test it | |
shell: bash | |
run: | | |
npm install | |
npm test |