diff options
author | Dan Nicholson <dbn@endlessos.org> | 2021-06-18 11:33:56 -0600 |
---|---|---|
committer | Dan Nicholson <dbn@endlessos.org> | 2021-06-18 15:30:06 -0600 |
commit | a0012ae0eea82d47a83b44a938d621535b7bc2da (patch) | |
tree | 14f88f6b42ae986e93c857a8031726dce39f4c9c /.github/workflows | |
parent | 9ff141fe80f145862c947c3a25d9367c01ebe43c (diff) | |
download | ostree-a0012ae0eea82d47a83b44a938d621535b7bc2da.tar.gz |
ci: Add GitHub Actions workflow for test suite
This runs the test suite in various distros. The intention is to use
this to replace the Travis CI setup since it often has rate limit
failures.
Each configuration in the matrix runs in a Docker container, installs
system dependencies and then builds and tests ostree. The scripts are
basically copy and paste of the travis ones with some of the lesser used
features pruned out.
Some differences from the travis setup:
* OS details are gathered from `/etc/os-release` instead of being passed
in as environment variables.
* The scripts always assume the user is root and don't try to use
`sudo`.
* The `installcheck` test has been removed since ostree doesn't actually
use that. It could be added to run the installed tests or
`gnome-desktop-testing-runner` could just be called directly.
There should be enough flexibility to run other distros like Fedora,
Arch or Alpine. Another option would be to use the other build scripts
in ci/.
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/tests.yml | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..436dfbe9 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,106 @@ +--- +name: Tests +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + tests: + # Distro configuration matrix + # + # Each build is run in a Docker container specific to the distro. + # When adding a new distro, handle the dependency installation in + # `ci/gh-install.sh`. The matrix configuration options are: + # + # name: A friendly name to use for the job. + # + # image: The Docker image to use. + # + # pre-checkout-setup: Commands to run before the git repo checkout. + # If git is not in the Docker image, it must be installed here. + # Otherwise, the checkout action uses the GitHub REST API, which + # doesn't result in an actual git repo. A real git repo is + # required to checkout the submodules. + # + # extra-packages: Packages to install in addition to those in + # `ci/gh-install.sh`. This can be used to support features from + # additional `configure` options. + # + # configure-options: Options to pass to `configure`. + strategy: + matrix: + include: + - name: Debian Buster (10) with sign-ed25519 + image: debian:buster-slim + pre-checkout-setup: | + apt-get update + apt-get install -y git + extra-packages: >- + libsodium-dev + configure-options: >- + --with-ed25519-libsodium + + - name: Debian Buster (10) with curl, sign-ed25519 and no gpgme + image: debian:buster-slim + pre-checkout-setup: | + apt-get update + apt-get install -y git + extra-packages: >- + libsodium-dev + configure-options: >- + --with-curl + --with-ed25519-libsodium + --without-gpgme + + # A 32 bit build to act as a proxy for frequently deployed 32 + # bit armv7 + - name: Debian Buster (10) 32 bit + image: i386/debian:buster-slim + # This is pretty nasty. The checkout action uses an x86_64 + # node binary in the container, so we need to provide an + # x86_64 ld.so and libstdc++. + pre-checkout-setup: | + dpkg --add-architecture amd64 + apt-get update + apt-get install -y git libc6:amd64 libstdc++6:amd64 + + - name: Ubuntu Focal (20.04) + image: ubuntu:focal + pre-checkout-setup: | + apt-get update + apt-get install -y git + + - name: Ubuntu Groovy (20.10) + image: ubuntu:groovy + pre-checkout-setup: | + apt-get update + apt-get install -y git + + name: ${{ matrix.name }} + runs-on: ubuntu-latest + container: + image: ${{ matrix.image }} + + steps: + - name: Pre-checkout setup + run: ${{ matrix.pre-checkout-setup }} + if: ${{ matrix.pre-checkout-setup }} + + - name: Checkout repository + uses: actions/checkout@v2 + with: + submodules: true + + - name: Install dependencies + run: ./ci/gh-install.sh ${{ matrix.extra-packages }} + + - name: Build and test + run: ./ci/gh-build.sh ${{ matrix.configure-options }} + env: + # GitHub hosted runners currently have 2 CPUs, so run 2 + # parallel make jobs. + # + # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners + MAKEFLAGS: -j2 |