Skip to content

Commit

Permalink
modify: Refine github workflow for unitTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhsu committed May 21, 2024
1 parent 4e77f96 commit d93a72c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
26 changes: 26 additions & 0 deletions .github/actions/prepare-building-env/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Prepare Building system"
runs:
using: "composite" # <-- this is the important part
steps:
- name: Install locales
shell: bash
run: |
apt-get update -y
apt-get install -y locales locales-all
- name: Install Base Packages
shell: bash
run: |
apt-get install -y apt-transport-https curl gnupg
apt-get -y install openjdk-17-jre openjdk-17-jdk-headless
apt-get -y install xorg-dev libglu1-mesa libgl1-mesa-dev xvfb libxinerama1 libxcursor1 libswt-gtk-4-java libswt-gtk-4-jni libxml2-utils bc
- name: Install SBT
shell: bash
run: |
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add
apt-get update -y
apt-get install -y sbt
16 changes: 4 additions & 12 deletions .github/workflows/unitTest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,16 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
EXCLUDE_TEST_TAG: moe.brianhsu.AudioOutputTest
LANG: en_US.utf-8
container:
image: ubuntu:22.04
steps:
- uses: actions/checkout@v3
- name: Install packages
run: |
apt-get update -y
apt-get install apt-transport-https curl gnupg -y
apt-get install openjdk-17-jre openjdk-17-jdk-headless -y
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add
apt-get update
apt-get -y install sbt
apt-get -y install xorg-dev libglu1-mesa libgl1-mesa-dev xvfb libxinerama1 libxcursor1 libswt-gtk-4-java libswt-gtk-4-jni libxml2-utils bc
- name: Prepare Building Envoriment
uses: ./.github/actions/prepare-building-env
- name: Unit test
run: |
LANG=C.utf-8 xvfb-run --auto-servernum sbt coverage test coverageAggregate
xvfb-run --auto-servernum sbt coverage test coverageAggregate
- name: Archive Test Results
if: always()
Expand Down

0 comments on commit d93a72c

Please sign in to comment.