Skip to content

Commit 1a01f40

Browse files
authored
Merge pull request #190 from emacs-tree-sitter/compilation-utilities
Compilation Utilities
2 parents 48b0679 + c656e7c commit 1a01f40

22 files changed

+817
-108
lines changed

.github/workflows/integ.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99

1010
jobs:
1111
integ:
12-
needs: publish-binaries
1312
strategy:
1413
fail-fast: false
1514
matrix:

.github/workflows/release.yml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
path: core/tsc-dyn.*${{ matrix.ext }}
9797
if-no-files-found: error
9898

99-
publish:
99+
publish-binaries:
100100
needs: build
101101
runs-on: ubuntu-18.04
102102
steps:
@@ -122,3 +122,64 @@ jobs:
122122
body_path: RELEASE-NOTES
123123
files: |
124124
tsc-dyn.*
125+
126+
integ:
127+
needs: publish-binaries
128+
strategy:
129+
fail-fast: false
130+
matrix:
131+
include:
132+
- os: macos-10.15
133+
emacs-version: '27.2'
134+
- os: ubuntu-18.04
135+
emacs-version: '27.2'
136+
# XXX: Fails on CI, but not locally (Windows 10) with
137+
# :value 2 :fail-reason "did not signal an error"
138+
# and
139+
# (different-types 443 (tsc . 1))
140+
#
141+
# - os: windows-2019
142+
# emacs-version: '27.2'
143+
runs-on: ${{ matrix.os }}
144+
steps:
145+
- uses: purcell/setup-emacs@v3.0
146+
if: runner.os != 'Windows'
147+
with:
148+
version: ${{ matrix.emacs-version }}
149+
- uses: jcs090218/setup-emacs-windows@v4
150+
if: runner.os == 'Windows'
151+
with:
152+
version: ${{ matrix.emacs-version }}
153+
154+
- uses: actions/checkout@v2
155+
156+
- run: .github/script/setup-cask
157+
- run: bin/setup
158+
159+
- run: bin/test integ
160+
161+
publish-melpa:
162+
needs: integ
163+
runs-on: ubuntu-18.04
164+
steps:
165+
- name: Set release version
166+
run: |
167+
echo "RELEASE_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
168+
169+
- name: Greenlight releasing to MELPA
170+
run: |
171+
git push origin ${{ env.RELEASE_VERSION }}:refs/heads/release
172+
continue-on-error: true
173+
174+
# We don't want this to trigger workflows, so we don't use a personal access token.
175+
- name: Greenlight releasing to MELPA Stable
176+
uses: actions/github-script@v4
177+
with:
178+
script: |
179+
github.git.createRef({
180+
owner: context.repo.owner,
181+
repo: context.repo.repo,
182+
ref: "refs/tags/melpa-stable/v${{ env.RELEASE_VERSION }}",
183+
sha: context.sha
184+
})
185+
continue-on-error: true

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

66
## [Unreleased]
7+
- Added customization option `tsc-dyn-get-from`, which is a list of sources to get the dynamic module `tsc-dyn` from. Its default value is `(:github :compilation)`.
78

89
## [0.16.1] - 2021-12-11
910
- Modified CI pipelines to publish additional pre-built dynamic modules. Their filenames include the platform they are built for. The files without platform in name will eventually be deprecated.

Cask

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
(source melpa)
66

77
(development
8-
(depends-on "rust-mode"))
8+
(depends-on "rust-mode")
9+
(depends-on "async"))

bin/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ echo "!! Building the dynamic module"
7171

7272
cp -f "$target_dir/$profile_/$MODULE_ORIGINAL" "$MODULE_RENAMED"
7373
version=$(cargo pkgid | cut -d'#' -f2 | cut -d: -f2)
74-
echo "$version".1 | tr -d $'\n' > DYN-VERSION
74+
echo "$version" | tr -d $'\n' > DYN-VERSION
7575
)
7676

7777
echo "!! Building Lisp code"

bin/test

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,20 @@ if [[ $* == "watch" ]]; then
1212
cargo watch -s ../bin/build -s ../bin/test
1313
)
1414
else
15+
if [[ $* == "integ" ]]; then
16+
test_mod="tsc-dyn-get-tests.el"
17+
else
18+
test_mod="tree-sitter-tests.el"
19+
fi
1520
(
1621
cd "$PROJECT_ROOT"
1722
cask emacs --batch \
1823
--directory "$PROJECT_ROOT/core" \
1924
--directory "$PROJECT_ROOT/lisp" \
2025
--directory "$PROJECT_ROOT/langs" \
26+
--directory "$PROJECT_ROOT/tests" \
2127
-l ert \
22-
-l tree-sitter-tests.el \
28+
-l "$test_mod" \
2329
-f ert-run-tests-batch-and-exit
2430
)
2531
fi

bin/test.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ if ($args[0] -eq "watch") {
99
Pop-Location
1010
}
1111
} else {
12+
if ($args[0] -eq "integ") {
13+
$test_mod = "tsc-dyn-get-tests.el"
14+
} else {
15+
$test_mod = "tree-sitter-tests.el"
16+
}
1217
# XXX: It seems that Emacs writes to stderr, so PowerShell thinks it's an error. Redirecting to
1318
# stdout alone doesn't help, because it's the processed stderr, which contain error records, not
1419
# the original stderr. Piping at the end to convert these error records into strings doesn't
@@ -29,8 +34,9 @@ if ($args[0] -eq "watch") {
2934
--directory "$project_root\core" `
3035
--directory "$project_root\lisp" `
3136
--directory "$project_root\langs" `
37+
--directory "$project_root\tests" `
3238
-l ert `
33-
-l tree-sitter-tests.el `
39+
-l "$test_mod" `
3440
-f ert-run-tests-batch-and-exit
3541
} finally {
3642
Pop-Location

0 commit comments

Comments
 (0)