Skip to content

Commit

Permalink
ci: update workflows to upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
theHamsta committed Apr 1, 2024
1 parent 284bed0 commit f3e269b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 42 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: CI

on:
push:
branches: [master]
paths:
pull_request:
branches: [master]

jobs:
build:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: tree-sitter/setup-action@v1
with:
install-lib: false
- uses: tree-sitter/[email protected]
with:
node-version: '16'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
test-library: true
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Publish package

on:
push:
tags: ["*"]

jobs:
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}}
52 changes: 18 additions & 34 deletions .github/workflows/update-cpp-parser.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,25 @@
name: Update Dependencies
name: Update

on:
schedule:
- cron: '0 0 * * *' # every day at midnight
push:
branches: ["master"]
- cron: "0 0 * * 0"
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
build:
test:
name: Update dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Update C parser
run: npm update
- name: Install dependencies
run: npm ci
- name: Regenerate Source Files
run: node_modules/.bin/tree-sitter generate
- name: Generate parser
run: npm install
- name: Run tests
run: npm test
- name: Update queries
run: ./generate-highlight.sh

- name: Commit changes
run: |
git config user.name "GitHub"
git config user.email "[email protected]"
git commit -am "Update dependencies and regenerate parser" || echo 'No commit necessary!'
git clean -xf
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
cache: npm
node-version: ${{vars.NODE_VERSION}}
- uses: tree-sitter/[email protected]
with:
commit-message: Update dependencies
title: Update dependencies
branch: update-dependencies-pr
base: ${{ github.head_ref }}
parent-name: c
language-name: glsl

0 comments on commit f3e269b

Please sign in to comment.