Skip to content

Commit

Permalink
Merge pull request #107 from ice-phoenix/marat.akhin/github-workflows
Browse files Browse the repository at this point in the history
WIP: Testing GitHub Actions
  • Loading branch information
ice-phoenix authored Aug 1, 2022
2 parents 4411e49 + a2fbee6 commit 9036bea
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/actions/build-spec-in-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: 'Build Kotlin spec in its Docker container'
runs:
using: 'docker'
image: './docker/Dockerfile'
entrypoint: '/build-spec.sh'
12 changes: 12 additions & 0 deletions .github/workflows/build-spec-on-pr-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Build Kotlin spec on PRs (version 2)'

on: [pull_request]

jobs:
build-spec:
runs-on: ubuntu-20.04
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Build Kotlin spec in its Docker container'
uses: ./.github/actions/build-spec-in-docker
44 changes: 44 additions & 0 deletions .github/workflows/build-spec-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build Kotlin spec on PRs

on: [pull_request]

jobs:
build-spec:
runs-on: ubuntu-20.04
steps:
- name: Setup Java 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
cache: 'gradle'
- name: Setup pandoc
env:
PANDOC_VERSION: 2.14.2
PANDOC_DEB: pandoc-2.14.2-1-amd64.deb
run: |
curl -sLO https://github.com/jgm/pandoc/releases/download/$PANDOC_VERSION/$PANDOC_DEB
sudo dpkg -i $PANDOC_DEB
rm $PANDOC_DEB
- name: Setup Kotlin spec dependencies
run: |
sudo apt-get update
sudo apt-get install -y gpp
sudo apt-get install -y librsvg2-bin
sudo apt-get install -y npm
curl -sL https://deb.nodesource.com/setup_18.x | bash -
sudo apt-get install -y nodejs
sudo apt-get install -y --no-install-recommends texlive-latex-extra
sudo apt-get install -y --no-install-recommends texlive-fonts-extra
sudo apt-get install -y --no-install-recommends texlive-bibtex-extra
sudo apt-get install -y --no-install-recommends texlive-science
sudo apt-get install -y --no-install-recommends fontconfig
sudo apt-get install -y --no-install-recommends lmodern
- name: Checkout repo
uses: actions/checkout@v3
- name: Build Kotlin spec
run: |
./gradlew buildPdf buildWeb
- name: Smoke test Kotlin grammar
run: |
./gradlew :grammar:jar
3 changes: 3 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ RUN tlmgr install --no-persistent-downloads cancel
RUN tlmgr install --no-persistent-downloads todonotes
RUN tlmgr install --no-persistent-downloads titlesec
RUN tlmgr install --no-persistent-downloads newunicodechar

# add build-spec.sh file for GitHub Actions
COPY build-spec.sh /build-spec.sh
7 changes: 7 additions & 0 deletions docker/build-spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

cd /github/workspace

./gradlew buildWeb buildPdf

./gradlew :grammar:jar

0 comments on commit 9036bea

Please sign in to comment.