From 50d79c7e81e4fdd4aa934c29aacbc045772c2d7e Mon Sep 17 00:00:00 2001 From: Matti Lupari Date: Thu, 16 Nov 2023 17:26:07 +0200 Subject: [PATCH] Try replacing Travis with Github Actions --- .github/workflows/scala.yml | 49 +++++++++++++++++++++++++++++++++++++ .travis.yml | 43 -------------------------------- 2 files changed, 49 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/scala.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml new file mode 100644 index 000000000..92d1d5997 --- /dev/null +++ b/.github/workflows/scala.yml @@ -0,0 +1,49 @@ +name: Exam + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_DB: sitnet_test + POSTGRES_USER: sitnet + POSTGRES_PASSWORD: sitnetsitnet + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v2 + with: + java-version: 21 + distribution: temurin + - uses: actions/checkout@v4 + - name: Set up Node 18 + uses: actions/setup-node@v4 + with: + node-version: 18.x + - name: Build UI + run: | + cd ui + rm -rf node_modules + npm i + npm run check-format + npm run check-lint + npm run build + cd .. + - name: Run tests + run: sbt test + + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 93a648ac7..000000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -os: linux - -dist: xenial - -language: - - scala - -jdk: - - openjdk21 - -node_js: - - 18 - -services: - - postgresql - -addons: - postgresql: "9.6" - -before_script: - - psql -c "CREATE USER sitnet WITH PASSWORD 'sitnetsitnet';" -U postgres - - psql -c 'CREATE DATABASE sitnet_test WITH OWNER 'sitnet';' -U postgres - - sed -i 's/\/var\/log\/exam/logs/g' $TRAVIS_BUILD_DIR/conf/logback.xml - - rm -rf ui/node_modules - - cd ui - - npm install -script: - - npm run build - - npm run check-format - - npm run check-lint - - cd .. - - sbt test - -before_cache: - # Tricks to avoid unnecessary cache updates - - find $HOME/.sbt -name "*.lock" | xargs rm - - find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm - -cache: - directories: - - $HOME/.cache/coursier - # $HOME/.ivy2/cache - - $HOME/.sbt