diff --git a/.github/workflows/bisect.yaml b/.github/workflows/bisect.yaml new file mode 100644 index 0000000..411df88 --- /dev/null +++ b/.github/workflows/bisect.yaml @@ -0,0 +1,36 @@ + +name: Bisect + +on: + - push + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + # https://github.com/actions/cache/issues/133 + - name: Fixup owner of ~/.cargo/ + # Don't remove the trailing /. It is necessary to follow the symlink. + run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/ + + - name: Cache cargo installed crates + uses: actions/cache@v1.1.2 + with: + path: ~/.cargo/bin + key: cargo-installed-crates + + - run: cargo install cargo-bisect-rustc || true + + #- name: Bisect + # run: cargo bisect-rustc "--start=2020-04-26" "--end=2020-04-28" | grep -v "for x86_64-unknown-linux-gnu" | tee log.txt + + run: echo "test" > log.txt + + - name: Upload log + run: curl -T log.txt $WEBHOOK/?upload_log=1 + env: + WEBHOOK: ${{ secrets.WEBHOOK }} + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..7c4c7b7 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cargo-bisect-bot" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..03afa7c --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "cargo-bisect-bot" +version = "0.1.0" +authors = ["bjorn3 "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/log.txt b/log.txt new file mode 100644 index 0000000..7898192 --- /dev/null +++ b/log.txt @@ -0,0 +1 @@ +a diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..1583b10 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,20 @@ +use std::sync::{Arc, RwLock}; + +#[derive(Copy, Clone)] +pub struct Glfw; + +fn fun_call(val: T) -> T { val } + +static mut GLFW: Option = None; +pub fn new() -> Result>, Box> { + //TODO: Give the option to choose FAIL / LOG? + let glfw = unsafe { if let Some(glfw) = GLFW { + glfw + } else { + let glfw = fun_call(Glfw); + GLFW = Some(glfw); + glfw + }}; + + Ok(Arc::new(RwLock::new(glfw))) +} \ No newline at end of file