Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Main workflow

on:
pull_request:
push:
schedule:
# Prime the caches every Monday
- cron: 0 1 * * MON

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- 4.13.x

runs-on: ${{ matrix.os }}

steps:
- run: |
sudo apt-get --allow-releaseinfo-change update && \
sudo apt-get install -y btrfs-progs zfs-dkms zfsutils-linux

- name: Checkout code
uses: actions/checkout@v2

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- run: opam install . --deps-only --with-test

- run: ./.run-gha-tests.sh
18 changes: 8 additions & 10 deletions .run-travis-tests.sh → .run-gha-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eux
export OPAMYES=true

sudo wget https://github.com/opencontainers/runc/releases/download/v1.0.0-rc92/runc.amd64 -O /usr/local/bin/runc
sudo wget https://github.com/opencontainers/runc/releases/download/v1.0.2/runc.amd64 -O /usr/local/bin/runc
sudo chmod a+x /usr/local/bin/runc

sudo sh -c "cat > /usr/local/bin/uname" << EOF
Expand All @@ -18,26 +18,24 @@ sudo chmod a+x /usr/local/bin/uname

dd if=/dev/zero of=/tmp/zfs.img bs=100M count=50
ZFS_LOOP=$(sudo losetup -f)
sudo losetup -P $ZFS_LOOP /tmp/zfs.img
sudo zpool create zfs $ZFS_LOOP
sudo losetup -P "$ZFS_LOOP" /tmp/zfs.img
sudo zpool create zfs "$ZFS_LOOP"

dd if=/dev/zero of=/tmp/btrfs.img bs=100M count=50
BTRFS_LOOP=$(sudo losetup -f)
sudo losetup -P $BTRFS_LOOP /tmp/btrfs.img
sudo mkfs.btrfs -f $BTRFS_LOOP
sudo losetup -P "$BTRFS_LOOP" /tmp/btrfs.img
sudo mkfs.btrfs -f "$BTRFS_LOOP"
sudo mkdir /btrfs
sudo mount -t btrfs $BTRFS_LOOP /btrfs
sudo chown $(whoami) /btrfs
sudo mount -t btrfs "$BTRFS_LOOP" /btrfs
sudo chown "$(whoami)" /btrfs

[ -d ~/.opam/4.11.1 ] || opam init --compiler=4.11.1
opam install --deps-only -t .
opam exec -- make
opam exec -- dune exec -- obuilder healthcheck --store=btrfs:/btrfs
opam exec -- dune exec -- obuilder healthcheck --store=zfs:zfs
opam exec -- dune exec -- ./stress/stress.exe btrfs:/btrfs
opam exec -- dune exec -- ./stress/stress.exe zfs:zfs

# Populate the caches from our own Travis cache
# Populate the caches from our own GitHub Actions cache
btrfs subvolume create /btrfs/cache/c-opam-archives
cp -r ~/.opam/download-cache/* /btrfs/cache/c-opam-archives/
sudo chown -R 1000:1000 /btrfs/cache/c-opam-archives
Expand Down
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion example.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
(user (uid 1000) (gid 1000)) ; Build as the "opam" user
(run (shell "sudo chown opam /src"))
(env OPAM_HASH "3332c004db65ef784f67efdadc50982f000b718f") ; Fix the version of opam-repository we want
(run
(run
(network host)
(shell "sudo apt-get --allow-releaseinfo-change update"))
(run
(network host)
(shell
"cd ~/opam-repository \
Expand Down