ci: update workflows
- Replace build workflow with CI & fuzz - Add GitHub & NPM release workflow
This commit is contained in:
committed by
Michael Hoffmann
parent
c3172d7873
commit
009def4ae3
33
.github/workflows/build.yaml
vendored
33
.github/workflows/build.yaml
vendored
@@ -1,33 +0,0 @@
|
||||
name: build
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
compiler: [gcc, clang, zig cc]
|
||||
include:
|
||||
- os: windows-latest
|
||||
compiler: cl.exe
|
||||
|
||||
name: compile
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- if: matrix.os == 'windows-latest' && matrix.compiler == 'gcc'
|
||||
uses: csukuangfj/setup-mingw@v2.2.1
|
||||
with:
|
||||
version: '12.2.0'
|
||||
|
||||
- if: matrix.compiler == 'cl.exe' && matrix.os == 'windows-latest'
|
||||
uses: seanmiddleditch/gha-setup-vsdevenv@master
|
||||
|
||||
- if: matrix.compiler == 'zig cc'
|
||||
uses: goto-bus-stop/setup-zig@v2
|
||||
|
||||
- name: build
|
||||
run: ${{ matrix.compiler }} -o scanner.o -I./src -c src/scanner.c
|
||||
65
.github/workflows/ci.yaml
vendored
Normal file
65
.github/workflows/ci.yaml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- grammar.js
|
||||
- make_grammar.js
|
||||
- src/**
|
||||
- test/**
|
||||
- example/**
|
||||
- bindings/**
|
||||
- binding.gyp
|
||||
pull_request:
|
||||
paths:
|
||||
- grammar.js
|
||||
- make_grammar.js
|
||||
- src/**
|
||||
- test/**
|
||||
- example/**
|
||||
- bindings/**
|
||||
- binding.gyp
|
||||
|
||||
concurrency:
|
||||
group: ${{github.workflow}}-${{github.ref}}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test parser
|
||||
runs-on: ${{matrix.os}}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up tree-sitter
|
||||
uses: tree-sitter/setup-action/cli@v1
|
||||
- name: Regenerate with ABI 14
|
||||
# TODO: remove when node & swift support ABI 15
|
||||
run: |-
|
||||
tree-sitter generate --abi=14
|
||||
cd dialects/terraform
|
||||
tree-sitter generate --abi=14
|
||||
- name: Run parser and binding tests
|
||||
uses: tree-sitter/parser-test-action@v2
|
||||
with:
|
||||
test-node: true
|
||||
test-rust: ${{runner.os == 'Linux'}}
|
||||
test-swift: ${{runner.os == 'macOS'}}
|
||||
- name: Parse sample files
|
||||
uses: tree-sitter/parse-action@v4
|
||||
id: parse-files
|
||||
with:
|
||||
files: |-
|
||||
example/**/*.hcl
|
||||
example/**/*.tf
|
||||
- name: Upload failures artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
if: "!cancelled() && steps.parse-files.outcome == 'failure'"
|
||||
with:
|
||||
name: failures-${{runner.os}}
|
||||
path: ${{steps.parse-files.outputs.failures}}
|
||||
28
.github/workflows/fuzz.yaml
vendored
Normal file
28
.github/workflows/fuzz.yaml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: fuzz
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- src/scanner.c
|
||||
- dialects/*/src/scanner.c
|
||||
pull_request:
|
||||
paths:
|
||||
- src/scanner.c
|
||||
- dialects/*/src/scanner.c
|
||||
|
||||
jobs:
|
||||
fuzz:
|
||||
name: Parser fuzzing
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
directory: [".", "dialects/terraform"]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Run fuzzer
|
||||
uses: tree-sitter/fuzz-action@v4
|
||||
with:
|
||||
directory: ${{matrix.directory}}
|
||||
28
.github/workflows/release.yaml
vendored
Normal file
28
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["*"]
|
||||
|
||||
concurrency:
|
||||
group: ${{github.workflow}}-${{github.ref}}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
attestations: write
|
||||
|
||||
jobs:
|
||||
release:
|
||||
uses: tree-sitter/workflows/.github/workflows/release.yml@main
|
||||
with:
|
||||
attestations: true
|
||||
npm:
|
||||
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
|
||||
secrets:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
crates:
|
||||
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
|
||||
secrets:
|
||||
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}}
|
||||
Reference in New Issue
Block a user