mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-12 08:00:08 +01:00
chore(ci): configure github-actions
This commit is contained in:
parent
9f466aea82
commit
9e774174d0
6 changed files with 224 additions and 1 deletions
74
.github/workflows/ci.yaml
vendored
Normal file
74
.github/workflows/ci.yaml
vendored
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- staging
|
||||
- trying
|
||||
|
||||
jobs:
|
||||
|
||||
test_linux:
|
||||
name: Test on Linux
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
rust: [1.50.0, stable, beta, nightly]
|
||||
steps:
|
||||
- name: Rust install
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
profile: minimal
|
||||
override: true
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
- name: Test
|
||||
run: ./ci/test_full.sh
|
||||
|
||||
test_macOS:
|
||||
name: Test on macOS 11
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- name: Rust install
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
target: aarch64-apple-darwin
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
- name: Test
|
||||
run: ./ci/test_full.sh
|
||||
# uses: actions-rs/cargo@v1
|
||||
# with:
|
||||
# command: test
|
||||
# args: --target aarch64-apple-darwin --all-features
|
||||
|
||||
|
||||
fmt:
|
||||
name: Format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Rust install
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.50.0
|
||||
profile: minimal
|
||||
override: true
|
||||
components: rustfmt
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Check formatting
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
31
.github/workflows/main.yaml
vendored
Normal file
31
.github/workflows/main.yaml
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
name: main
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
schedule:
|
||||
- cron: '0 0 * * 0' # 00:00 Sunday
|
||||
|
||||
jobs:
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
rust: [1.50.0, stable]
|
||||
steps:
|
||||
- name: Rust install
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
profile: minimal
|
||||
override: true
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
- name: Test
|
||||
run: ./ci/test_full.sh
|
||||
46
.github/workflows/pr.yaml
vendored
Normal file
46
.github/workflows/pr.yaml
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
name: PR
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
rust: [1.50.0, stable]
|
||||
steps:
|
||||
- name: Rust install
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
profile: minimal
|
||||
override: true
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
- name: Test
|
||||
run: ./ci/test_full.sh
|
||||
|
||||
fmt:
|
||||
name: Format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Rust install
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.42.0
|
||||
profile: minimal
|
||||
override: true
|
||||
components: rustfmt
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Check formatting
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
# tmux-copyrat
|
||||
|
||||

|
||||
[](https://crates.io/crates/tmux-copyrat)
|
||||
[](https://docs.rs/tmux-copyrat)
|
||||
[](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
|
||||
[](https://github.com/graelo/tmux-copyrat/actions)
|
||||
|
||||
|
||||
A hommage to [tmux-copyrat](https://github.com/tmux-plugins/tmux-copycat), written in [Rust](https://www.rust-lang.org/) for copy pasting within [tmux](http://tmux.github.io).
|
||||
|
||||
|
|
|
|||
10
ci/rustup.sh
Executable file
10
ci/rustup.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
# Use rustup to locally run the same suite of tests as .github/workflows/
|
||||
# (You should first install/update all of the versions below.)
|
||||
|
||||
set -ex
|
||||
|
||||
ci=$(dirname $0)
|
||||
for version in 1.50.0 stable beta nightly; do
|
||||
rustup run "$version" "$ci/test_full.sh"
|
||||
done
|
||||
58
ci/test_full.sh
Executable file
58
ci/test_full.sh
Executable file
|
|
@ -0,0 +1,58 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
CRATE=tmux-copyrat
|
||||
MSRV=1.50
|
||||
|
||||
get_rust_version() {
|
||||
local array=($(rustc --version));
|
||||
echo "${array[1]}";
|
||||
return 0;
|
||||
}
|
||||
RUST_VERSION=$(get_rust_version)
|
||||
|
||||
check_version() {
|
||||
IFS=. read -ra rust <<< "$RUST_VERSION"
|
||||
IFS=. read -ra want <<< "$1"
|
||||
[[ "${rust[0]}" -gt "${want[0]}" ||
|
||||
( "${rust[0]}" -eq "${want[0]}" &&
|
||||
"${rust[1]}" -ge "${want[1]}" )
|
||||
]]
|
||||
}
|
||||
|
||||
echo "Testing $CRATE on rustc $RUST_VERSION"
|
||||
if ! check_version $MSRV ; then
|
||||
echo "The minimum for $CRATE is rustc $MSRV"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FEATURES=()
|
||||
# check_version 1.27 && FEATURES+=(libm)
|
||||
echo "Testing supported features: ${FEATURES[*]}"
|
||||
|
||||
set -x
|
||||
|
||||
# test the default
|
||||
cargo build
|
||||
cargo test
|
||||
|
||||
# test `no_std`
|
||||
cargo build --no-default-features
|
||||
cargo test --no-default-features
|
||||
|
||||
# test each isolated feature, with and without std
|
||||
for feature in ${FEATURES[*]}; do
|
||||
# cargo build --no-default-features --features="std $feature"
|
||||
# cargo test --no-default-features --features="std $feature"
|
||||
|
||||
cargo build --no-default-features --features="$feature"
|
||||
cargo test --no-default-features --features="$feature"
|
||||
done
|
||||
|
||||
# test all supported features, with and without std
|
||||
# cargo build --features="std ${FEATURES[*]}"
|
||||
# cargo test --features="std ${FEATURES[*]}"
|
||||
|
||||
cargo build --features="${FEATURES[*]}"
|
||||
cargo test --features="${FEATURES[*]}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue