Skip to content

Commit ef0cb3b

Browse files
authored
Merge pull request #243 from fwcd/gh-actions
Migrate to GitHub Actions
2 parents 7b48721 + 629c9aa commit ef0cb3b

File tree

14 files changed

+98
-89
lines changed

14 files changed

+98
-89
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ indent_style=space
88
indent_size=4
99
trim_trailing_whitespace=true
1010

11-
[.travis.yml]
11+
[*.yml]
1212
indent_size=2

.github/workflows/build.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Build
2+
on: [push]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
java: ['11']
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Setup JDK
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: ${{ matrix.java }}
16+
- name: Build
17+
run: ./gradlew :server:build :shared:build

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Setup JDK
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: 11
16+
- name: Build distribution
17+
run: ./gradlew :server:distZip :grammars:distZip
18+
- name: Create release
19+
uses: actions/create-release@v1
20+
id: create_release
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
with:
24+
tag_name: ${{ github.ref }}
25+
release_name: Version ${{ github.ref }}
26+
draft: false
27+
prerelease: false
28+
- name: Upload server asset
29+
uses: actions/upload-release-asset@v1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
upload_url: ${{ steps.create_release.outputs.upload_url }}
34+
asset_path: ./server/build/distributions/server.zip
35+
asset_name: server.zip
36+
asset_content_type: application/zip
37+
- name: Upload grammar asset
38+
uses: actions/upload-release-asset@v1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
upload_url: ${{ steps.create_release.outputs.upload_url }}
43+
asset_path: ./grammars/build/distributions/grammars.zip
44+
asset_name: grammars.zip
45+
asset_content_type: application/zip
46+
- name: Deploy Docker image to GitHub Packages
47+
run: ./scripts/deploy-docker
48+
- name: Deploy Maven artifacts to GitHub Packages
49+
run: ./scripts/deploy-maven

.travis.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Kotlin Language Server
22
[![Release](https://img.shields.io/github/release/fwcd/kotlin-language-server)](https://github.com/fwcd/kotlin-language-server/releases)
3-
[![Build Status](https://travis-ci.org/fwcd/kotlin-language-server.svg?branch=master)](https://travis-ci.org/fwcd/kotlin-language-server)
3+
[![Build](https://github.com/fwcd/kotlin-language-server/workflows/Build/badge.svg)](https://github.com/fwcd/kotlin-language-server/actions)
44
[![Downloads](https://img.shields.io/github/downloads/fwcd/kotlin-language-server/total)](https://github.com/fwcd/kotlin-language-server/releases)
55
[![Chat](https://img.shields.io/badge/chat-on%20discord-7289da)](https://discord.gg/cNtppzN)
66

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
2-
docker login docker.pkg.github.com -u fwcd -p "$GH_TOKEN"
2+
docker login docker.pkg.github.com -u fwcd -p "$GITHUB_TOKEN"
33
docker build -t docker.pkg.github.com/fwcd/kotlin-language-server/server:latest .
44
docker push docker.pkg.github.com/fwcd/kotlin-language-server/server:latest
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
./gradlew :shared:publish :server:publish -x test -Pgpr.user=fwcd -Pgpr.key="$GH_TOKEN"
2+
./gradlew :shared:publish :server:publish -x test -Pgpr.user=fwcd -Pgpr.key="$GITHUB_TOKEN"

server/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'org.jetbrains.kotlin.jvm'
3-
id 'maven'
3+
id 'maven-publish'
44
id 'application'
55
id 'com.github.jk1.tcdeps' version '1.2'
66
id 'com.jaredsburrows.license' version '0.8.42'

server/src/test/kotlin/org/javacs/kt/AdditionalWorkspaceTest.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ class AdditionalWorkspaceTest : LanguageServerTestFixture("mainWorkspace") {
2828
open(file)
2929

3030
val hover = languageServer.textDocumentService.hover(hoverParams(file, 5, 14)).get()!!
31-
32-
assertThat(hover.contents.left, not(emptyList()))
33-
assertThat(hover.contents.left.first().right.value, containsString("fun assertTrue"))
31+
assertThat(hover.contents.right.value, containsString("fun assertTrue"))
3432
}
3533

3634
@Ignore // TODO
@@ -42,7 +40,6 @@ class AdditionalWorkspaceTest : LanguageServerTestFixture("mainWorkspace") {
4240

4341
addWorkspaceRoot()
4442
val hoverAgain = languageServer.textDocumentService.hover(hoverParams(file, 5, 14)).get() ?: return fail("No hover")
45-
assertThat(hoverAgain.contents.left, not(emptyList()))
46-
assertThat(hoverAgain.contents.left.first().right.value, containsString("fun assertTrue"))
43+
assertThat(hoverAgain.contents.right.value, containsString("fun assertTrue"))
4744
}
4845
}

server/src/test/kotlin/org/javacs/kt/CompiledFileTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.javacs.kt
22

33
import org.hamcrest.Matchers.equalTo
4+
import org.javacs.kt.compiler.Compiler
45
import org.junit.Assert.assertThat
56
import org.junit.Test
67
import org.junit.BeforeClass

0 commit comments

Comments
 (0)