Skip to content

Commit

Permalink
Integrate GitHub Actions
Browse files Browse the repository at this point in the history
Define a GitHub Actions CI pipeline that builds for Linux on MSRV,
stable, and next, and makes a half-arsed attempt at verifying MSRV on
Windows.

Because several dependencies rely on wildcards the de facto MSRVs are a
fair bit higher than advertised:

- getopts unceremoniously abandoned MSRV pretence in 0.2.20 and raised
  MSRV from 1.18 to 1.27, then again to 1.31 in 0.2.21.
- libloading 0.6.0 for "unix" uses MaybeUninit, which requires 1.36.
- libloading 0.6.0 for "windows" uses pointer::cast(), which requires
  1.38, and the non_exhaustive feature, which requires 1.40.

Of course, the original MSRVs can be restored by fixing dependencies.

I've retained the Linux/Windows MSRV split out of precedence. It makes
some sense given the build dependency difference, though I'd argue for
simplifying communication by maintaining only one MSRV.
  • Loading branch information
commonquail committed Apr 14, 2020
1 parent 0f642a6 commit bcfd45d
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: ci

on:
pull_request:
push:
branches:
- master

jobs:
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build:
# MSRV, stable, and next.
- pinned-linux
- stable
- beta
# Best-effort Windows.
- pinned-windows
include:
- build: pinned-linux
os: ubuntu-18.04
rust: 1.36.0

- build: stable
os: ubuntu-18.04
rust: stable

- build: beta
os: ubuntu-18.04
rust: beta

- build: pinned-windows
os: windows-2019
rust: 1.40.0
env:
# libXNVCtrl.a in Ubuntu
LIBRARY_PATH: /usr/lib/x86_64-linux-gnu
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-18.04'
run: |
ci/ubuntu-install-packages
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true

# Can't (easily) install NVAPI for Windows. :(
- name: Check-only (Windows)
if: matrix.os == 'windows-2019'
run: cargo check --verbose

- name: Build
if: matrix.os != 'windows-2019'
run: cargo build --verbose

- name: Test
if: matrix.os != 'windows-2019'
run: cargo test --verbose
5 changes: 5 additions & 0 deletions ci/ubuntu-install-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
libxnvctrl-dev

0 comments on commit bcfd45d

Please sign in to comment.