Skip to content

Commit

Permalink
Merge pull request #260 from jcs-PR/test/eask
Browse files Browse the repository at this point in the history
test: Build with Eask
  • Loading branch information
jcs090218 committed Sep 9, 2023
2 parents fa5a072 + e2191d1 commit 88c41a0
Show file tree
Hide file tree
Showing 18 changed files with 147 additions and 112 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ on:
- doc
paths:
- doc/**
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
publish-doc:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -26,15 +30,15 @@ jobs:
hugo version
- name: Set up Emacs
uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a
uses: jcs090218/setup-emacs@master
with:
version: '27.2'

- name: Generate markdown files
run: bin/dev generate-doc-md

- name: Check out GitHub page repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: emacs-tree-sitter/emacs-tree-sitter.github.io
path: emacs-tree-sitter.github.io
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/integ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,36 @@ on:
required: true
default: 'master'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
integ:
strategy:
fail-fast: false
matrix:
os:
- macos-10.15
- macos-12
- ubuntu-18.04
- windows-2019
emacs-version:
- '27.2'
- '28.1'
runs-on: ${{ matrix.os }}
steps:
- uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a
if: runner.os != 'Windows'
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}

- uses: jcs090218/setup-emacs-windows@6e1ba035e1387639a42f4ef4872598c88481c863
if: runner.os == 'Windows'
- uses: actions/checkout@v4
with:
version: ${{ matrix.emacs-version }}
# Remove expired DST Root CA X3 certificate. Workaround for
# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 bug on Emacs 27.2.
# https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-1126671598
- name: Workaround for Emacs 27.2's Windows build from GNU FTP
if: ${{ runner.os == 'Windows' && matrix.emacs-version == '27.2' }}
run: |
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item
ref: ${{ github.event.inputs.revision }}

- uses: actions/checkout@v2
- uses: emacs-eask/setup-eask@master
with:
ref: ${{ github.event.inputs.revision }}
version: 'snapshot'

- run: .github/script/setup-cask
- run: bin/setup

- run: bin/test integ
37 changes: 16 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,30 @@ on:
paths-ignore:
- '*.md'
- doc/**
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
strategy:
fail-fast: false
matrix:
os:
- macos-10.15
- macos-12
- ubuntu-20.04
- windows-2019
emacs-version:
- '27.2'
- '28.1'
include:
- os: macos-11
- os: macos-12
emacs-version: '27.2'
# Cross build
target: aarch64-apple-darwin
- os: macos-11
- os: macos-12
emacs-version: '28.1'
# Cross build
target: aarch64-apple-darwin
Expand All @@ -49,41 +54,31 @@ jobs:
run: |
rustup target add ${{ matrix.target }}
# Using a specific commit hash to fix this https://github.com/purcell/setup-emacs/issues/24.
- uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a
if: runner.os != 'Windows'
with:
version: ${{ matrix.emacs-version }}

- uses: jcs090218/setup-emacs-windows@6e1ba035e1387639a42f4ef4872598c88481c863
if: runner.os == 'Windows'
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}
# Remove expired DST Root CA X3 certificate. Workaround for
# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 bug on Emacs 27.2.
# https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-1126671598
- name: Workaround for Emacs 27.2's Windows build from GNU FTP
if: ${{ runner.os == 'Windows' && matrix.emacs-version == '27.2' }}
run: |
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true

- run: .github/script/setup-cask
- uses: emacs-eask/setup-eask@master
with:
version: 'snapshot'

- run: bin/setup
- run: bin/build -target "${{ matrix.target }}"
continue-on-error: true

- run: bin/inspect-binaries
continue-on-error: true

- name: Install tree-sitter CLI
if: ${{ !matrix.target }}
run: npm install -g tree-sitter-cli@0.19.3
- run: eask install-deps --dev
- run: bin/test
if: ${{ !matrix.target }}
continue-on-error: true
- run: bin/test bench
if: ${{ !matrix.target }}
58 changes: 20 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
tags:
- '*.*.*'
- '!melpa-stable*'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
Expand All @@ -13,11 +18,11 @@ jobs:
matrix:
include:
# TODO: Get host platform from rustc instead of specifying it explicitly.
- os: macos-10.15
- os: macos-11
emacs-version: '27.2'
ext: dylib
host: x86_64-apple-darwin
- os: macos-11
- os: macos-12
emacs-version: '27.2'
ext: dylib
target: aarch64-apple-darwin
Expand All @@ -41,30 +46,18 @@ jobs:
run: |
rustup target add ${{ matrix.target }}
- uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a
if: runner.os != 'Windows'
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}

- uses: jcs090218/setup-emacs-windows@6e1ba035e1387639a42f4ef4872598c88481c863
if: runner.os == 'Windows'
- uses: emacs-eask/setup-eask@master
with:
version: ${{ matrix.emacs-version }}
# Remove expired DST Root CA X3 certificate. Workaround for
# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 bug on Emacs 27.2.
# https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-1126671598
- name: Workaround for Emacs 27.2's Windows build from GNU FTP
if: ${{ runner.os == 'Windows' && matrix.emacs-version == '27.2' }}
run: |
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item
version: 'snapshot'

- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true

- run: .github/script/setup-cask

- run: bin/setup
- run: bin/build -target "${{ matrix.target }}"

Expand Down Expand Up @@ -100,10 +93,10 @@ jobs:
needs: build
runs-on: ubuntu-18.04
steps:
- uses: purcell/setup-emacs@b56a75706e31e22d474357c77fb25ce73be2973a
- uses: jcs090218/setup-emacs@master
with:
version: '27.2'
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Generate release notes
run: |
bin/dev release-notes $(git describe --tags --abbrev=0) > RELEASE-NOTES
Expand All @@ -129,7 +122,7 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-10.15
- os: macos-12
emacs-version: '27.2'
- os: ubuntu-18.04
emacs-version: '27.2'
Expand All @@ -142,27 +135,16 @@ jobs:
# emacs-version: '27.2'
runs-on: ${{ matrix.os }}
steps:
- uses: purcell/setup-emacs@v3.0
if: runner.os != 'Windows'
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}

- uses: jcs090218/setup-emacs-windows@6e1ba035e1387639a42f4ef4872598c88481c863
if: runner.os == 'Windows'
with:
version: ${{ matrix.emacs-version }}
# Remove expired DST Root CA X3 certificate. Workaround for
# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 bug on Emacs 27.2.
# https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-1126671598
- name: Workaround for Emacs 27.2's Windows build from GNU FTP
if: ${{ runner.os == 'Windows' && matrix.emacs-version == '27.2' }}
run: |
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item
- uses: actions/checkout@v4

- uses: actions/checkout@v2
- uses: emacs-eask/setup-eask@master
with:
version: 'snapshot'

- run: .github/script/setup-cask
- run: bin/setup

- run: bin/test integ
Expand All @@ -171,7 +153,7 @@ jobs:
needs: integ
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set release version
run: |
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ on:
default: macos-latest
description: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ github.event.inputs.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.revision }}
- uses: mxschmitt/action-tmate@v3
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
**/*.elc*
**/.cask
**/.eask
**/dist
28 changes: 28 additions & 0 deletions Eask
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
(package "tree-sitter"
"0.18.0"
"Incremental parsing system")

(website-url "https://github.com/emacs-tree-sitter/elisp-tree-sitter")
(keywords "languages" "tools" "parsers" "tree-sitter")

(package-file "lisp/tree-sitter.el")
(files
"lisp/*.el")

(script "test" "echo \"Error: no test specified\" && exit 1")

(source 'melpa)

(depends-on "emacs" "27.1")
(depends-on "tsc")

(development
(depends-on "rust-mode")
(depends-on "async")
)

(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432

;; Use GNU tar in Windows
(when (memq system-type '(cygwin windows-nt ms-dos))
(setq package-build-tar-executable "C:/Program Files/Git/usr/bin/tar.exe"))
4 changes: 2 additions & 2 deletions bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ if [[ $target != '' ]]; then
fi
(
cd "$core_root"
cask build
eask compile --allow-error
)
(
cd "$PROJECT_ROOT"
cask build
eask compile --allow-error
)
4 changes: 2 additions & 2 deletions bin/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ try {
Copy-Item "target\$profile\${module_name}.dll" "${module_renamed}.dll"
$version = ((cargo pkgid) | Out-String).Trim().Split('#')[-1].Split(':')[-1]
Set-Content -Path "DYN-VERSION" -Value "${version}" -NoNewLine -Force
cask build
eask compile --allow-error
} finally {
Pop-Location
}

echo "!! Building Lisp code"
Push-Location $project_root
try {
cask build
eask compile --allow-error
} finally {
Pop-Location
}
Loading

0 comments on commit 88c41a0

Please sign in to comment.