Skip to content

Commit

Permalink
Merge pull request #7 from bk2204/cleanups
Browse files Browse the repository at this point in the history
Various cleanups for CI
  • Loading branch information
bk2204 authored May 8, 2024
2 parents 1bab6f2 + 7d280f6 commit 60939f6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 42 deletions.
38 changes: 27 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
name: Linux (Debian bullseye amd64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-ruby@v1
- run: make ci-bullseye
- uses: actions/upload-artifact@v2
Expand All @@ -17,7 +17,7 @@ jobs:
name: Linux (Debian bullseye armel)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-ruby@v1
- run: |
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
Expand All @@ -35,7 +35,7 @@ jobs:
name: Linux (Debian bullseye arm64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-ruby@v1
- run: |
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
Expand All @@ -53,14 +53,14 @@ jobs:
name: Linux (oldest Rust)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-ruby@v1
- run: make ci-oldest
build-stable:
name: Linux (Rust stable)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-ruby@v1
- run: make ci-stable
env:
Expand All @@ -69,33 +69,49 @@ jobs:
name: Linux (Rust nightly)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-ruby@v1
- run: make ci-nightly
env:
FEATURES: modern
build-freebsd:
name: FreeBSD
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-ruby@v1
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- run: sudo apt-get -y install vagrant vagrant-libvirt libvirt-daemon-system
- run: sudo service libvirtd start
- run: sudo chmod 666 /var/run/libvirt/libvirt-sock
- run: make ci-freebsd
build-netbsd:
name: NetBSD
runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- run: sudo apt-get -y install vagrant vagrant-libvirt libvirt-daemon-system
- run: sudo service libvirtd start
- run: sudo chmod 666 /var/run/libvirt/libvirt-sock
- run: make ci-netbsd
build-mac:
name: macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: brew install ruby asciidoctor rust
- run: make test-full
env:
Expand Down
7 changes: 0 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
extern crate autocfg;

fn main() {
let ac = autocfg::new();
ac.emit_rustc_version(1, 37);
ac.emit_trait_cfg(
"std::ops::RangeBounds<std::ops::Range<usize>>",
"has_range_bounds",
);

// Ideally we'd allow arbitrary byte paths here, but Rust's env! doesn't support that. If this
// becomes a problem, we can always percent-encode as a workaround.
let sharedir = match (
Expand Down
2 changes: 1 addition & 1 deletion src/lib/codec/codecs/uuencode.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(unknown_lints)]
#![allow(bare_trait_objects)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::manual_range_contains))]
#![allow(clippy::manual_range_contains)]

use codec::helpers::codecs::FilteredDecoder;
use codec::Codec;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/codec/codecs/vis.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(unknown_lints)]
#![allow(bare_trait_objects)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::manual_range_contains))]
#![allow(clippy::manual_range_contains)]

use codec::Codec;
use codec::CodecSettings;
Expand Down
22 changes: 0 additions & 22 deletions src/lib/codec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,34 +237,12 @@ impl<R: BufRead, C: Codec> CodecReader<R, C> {
}
}

#[cfg(rustc_1_37)]
fn memmove<B>(sl: &mut [u8], src: B, dest: usize)
where
B: ops::RangeBounds<usize> + IntoIterator<Item = usize>,
{
sl.copy_within(src, dest)
}

#[cfg(all(not(rustc_1_37), has_range_bounds))]
fn memmove<B>(sl: &mut [u8], src: B, dest: usize)
where
B: ops::RangeBounds<usize> + IntoIterator<Item = usize>,
{
match src.start_bound() {
ops::Bound::Included(&x) if x == dest => return,
_ => (),
};
for (j, i) in src.into_iter().enumerate() {
sl[j] = sl[i + dest];
}
}

#[cfg(all(not(rustc_1_37), not(has_range_bounds)))]
fn memmove(sl: &mut [u8], src: ops::Range<usize>, dest: usize) {
for (j, i) in src.into_iter().enumerate() {
sl[j] = sl[i + dest];
}
}
}

// This function and associated types derived from the flate2 crate.
Expand Down

0 comments on commit 60939f6

Please sign in to comment.