summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorDan Nicholson <dbn@endlessos.org>2021-06-21 10:46:51 -0600
committerGitHub <noreply@github.com>2021-06-21 10:46:51 -0600
commitb6a55ab8f3f75ce294899898970f4a73b8ab2828 (patch)
tree0c5cb4d7b3949c911f7945ad0f254bf78c513a50 /.github
parent7ff848f1019b9a497c650c24d6b14e346c9919e0 (diff)
parent00f7c88a2dce019b9e6f06f31c9e64793f7efe57 (diff)
downloadostree-b6a55ab8f3f75ce294899898970f4a73b8ab2828.tar.gz
Merge pull request #2379 from dbnicholson/gh-actions-tests
Replace Travis CI with GitHub Actions
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/rust.yml27
-rw-r--r--.github/workflows/tests.yml107
2 files changed, 120 insertions, 14 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
new file mode 100644
index 00000000..70233b8e
--- /dev/null
+++ b/.github/workflows/rust.yml
@@ -0,0 +1,27 @@
+---
+name: Rust
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+env:
+ CARGO_TERM_COLOR: always
+ ACTIONS_LINTS_TOOLCHAIN: 1.50.0
+
+jobs:
+ linting:
+ name: "Lints, pinned toolchain"
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ - name: Install toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: ${{ env['ACTIONS_LINTS_TOOLCHAIN'] }}
+ default: true
+ components: rustfmt, clippy
+ - name: cargo fmt (check)
+ run: cargo fmt -- --check -l
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 70233b8e..436dfbe9 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -1,27 +1,106 @@
---
-name: Rust
+name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
-env:
- CARGO_TERM_COLOR: always
- ACTIONS_LINTS_TOOLCHAIN: 1.50.0
-
jobs:
- linting:
- name: "Lints, pinned toolchain"
+ 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
- - name: Install toolchain
- uses: actions-rs/toolchain@v1
with:
- toolchain: ${{ env['ACTIONS_LINTS_TOOLCHAIN'] }}
- default: true
- components: rustfmt, clippy
- - name: cargo fmt (check)
- run: cargo fmt -- --check -l
+ 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