From a2325edba3d49dce82950ba3005c332d9d620e50 Mon Sep 17 00:00:00 2001 From: Anurag Soni Date: Fri, 6 Dec 2019 17:54:58 -0500 Subject: [PATCH] Use github actions Closes #115 --- .github/workflows/format.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ .travis.yml | 34 ---------------------------------- 3 files changed, 55 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/format.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..f8474ccc --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,28 @@ +name: Format +on: + push: + branches: + - master +jobs: + build: + name: Format OCaml code + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: avsm/setup-ocaml@v1.0 + with: + ocaml-version: 4.09.0 + - name: Install dependencies + run: opam install dune ocamlformat + - name: Build + run: opam exec -- dune build + - name: Format + run: opam exec -- dune build @fmt --auto-promote || true + - name: Create Pull Request + uses: peter-evans/create-pull-request@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: ocamlformat fixes + title: ocamlformat fixes + body: This is an auto-generated PR with fixes by ocamlformat. + labels: ocamlformat, automated pr diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..fd0a1f9a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: RoutesTest +on: + pull_request: +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ocaml-version: [ '4.09.0', '4.08.1', '4.07.1', '4.06.1', '4.05.0', '4.04.1' ] + steps: + - uses: actions/checkout@master + - uses: avsm/setup-ocaml@v1.0 + with: + ocaml-version: ${{ matrix.ocaml-version }} + - name: Install dependencies + run: | + opam pin add opium_kernel.dev -n . + opam pin add opium.dev -n + opam depext -yt opium_kernel + opam depext -yt opium + opam install -t . --deps-only + - name: Build + run: opam exec -- dune build + - name: Run tests + run: opam exec -- dune runtest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5ce88cfb..00000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: c -install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-docker.sh -script: bash -ex .travis-docker.sh -services: -- docker -env: - global: - - EXTRA_REMOTES="https://github.com/mirage/mirage-dev.git" - - PINS="opium_kernel:. opium:." - matrix: - - PACKAGE="opium_kernel" DISTRO="ubuntu-18.04" OCAML_VERSION="4.04" - - PACKAGE="opium" DISTRO="ubuntu-18.04" OCAML_VERSION="4.04" - - PACKAGE="opium_kernel" DISTRO="ubuntu-18.04" OCAML_VERSION="4.05" - - PACKAGE="opium" DISTRO="ubuntu-18.04" OCAML_VERSION="4.05" - - PACKAGE="opium_kernel" DISTRO="ubuntu-18.04" OCAML_VERSION="4.06" - - PACKAGE="opium" DISTRO="ubuntu-18.04" OCAML_VERSION="4.06" - - PACKAGE="opium_kernel" DISTRO="ubuntu-18.04" OCAML_VERSION="4.07" - - PACKAGE="opium" DISTRO="ubuntu-18.04" OCAML_VERSION="4.07" - - PACKAGE="opium_kernel" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04" - - PACKAGE="opium" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04" - - PACKAGE="opium_kernel" DISTRO="ubuntu-16.04" OCAML_VERSION="4.05" - - PACKAGE="opium" DISTRO="ubuntu-16.04" OCAML_VERSION="4.05" - - PACKAGE="opium_kernel" DISTRO="ubuntu-16.04" OCAML_VERSION="4.06" - - PACKAGE="opium" DISTRO="ubuntu-16.04" OCAML_VERSION="4.06" - - PACKAGE="opium_kernel" DISTRO="ubuntu-16.04" OCAML_VERSION="4.07" - - PACKAGE="opium" DISTRO="ubuntu-16.04" OCAML_VERSION="4.07" - - PACKAGE="opium_kernel" DISTRO="alpine" OCAML_VERSION="4.04" - - PACKAGE="opium" DISTRO="alpine" OCAML_VERSION="4.04" - - PACKAGE="opium_kernel" DISTRO="alpine" OCAML_VERSION="4.05" - - PACKAGE="opium" DISTRO="alpine" OCAML_VERSION="4.05" - - PACKAGE="opium_kernel" DISTRO="alpine" OCAML_VERSION="4.06" - - PACKAGE="opium" DISTRO="alpine" OCAML_VERSION="4.06" - - PACKAGE="opium_kernel" DISTRO="alpine" OCAML_VERSION="4.07" - - PACKAGE="opium" DISTRO="alpine" OCAML_VERSION="4.07"