From 33733f388e1be56161fa73628830ace7ffe4685e Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Fri, 15 Dec 2023 21:17:26 +0100 Subject: [PATCH] Replace TravisCI with Github Actions --- .github/workflows/ci.yaml | 38 ++++++++++++++++++++++++++++++++++ .travis.yml | 43 --------------------------------------- 2 files changed, 38 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..dd6223a --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,38 @@ +name: Run tests +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + TEST_ENV: [ubuntu-18.04-llvm-5.0, ubuntu-18.04-llvm-6.0. formatting] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Compose + run: | + sudo apt-get update + sudo apt-get install -y docker-compose + + - name: Build and run tests + run: | + docker-compose build ${{ matrix.TEST_ENV }} + docker-compose run ${{ matrix.TEST_ENV }} + if [[ "${{ matrix.TEST_ENV }}" = *llvm-6.0 ]]; then + export VERSION="${{ github.sha }}"; + docker-compose build bindgen; + find . -name target | xargs sudo rm -rf; + scripts/docker-test.sh; + fi + + - name: Check formatting + if: matrix.TEST_ENV == 'formatting' + run: | + clang-format --version + scripts/scalafmt --test + scripts/clangfmt --test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 062b8f4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: scala -sudo: required -os: linux -dist: trusty -jdk: oraclejdk8 - -scala: - - "2.11.12" - -before_script: - - docker-compose build $TEST_ENV - -script: - - docker-compose run $TEST_ENV - - if [[ "$TEST_ENV" = *llvm-6.0 ]]; then - export VERSION="${TRAVIS_COMMIT}"; - docker-compose build bindgen; - find . -name target | xargs sudo rm -rf; - scripts/docker-test.sh; - fi - -matrix: - include: - - env: TEST_ENV=ubuntu-18.04-llvm-6.0 - - env: TEST_ENV=ubuntu-18.04-llvm-5.0 - - env: TEST_ENV=formatting - before_script: - - clang-format --version - script: - - scripts/scalafmt --test; - - scripts/clangfmt --test; - -before_cache: - # See https://www.scala-sbt.org/1.0/docs/Travis-CI-with-sbt.html - # Tricks to avoid unnecessary cache updates - - find $HOME/.sbt -name "*.lock" | xargs sudo rm - - find $HOME/.ivy2 -name "ivydata-*.properties" | xargs sudo rm - -cache: - directories: - - "$HOME/.ivy2/cache" - - "$HOME/.sbt/boot/scala-*" - - "$HOME/.coursier"