Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
Bisect job for comment id 623120871 (bjorn3/cargo-bisect-rustc-bot#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed May 3, 2020
0 parents commit 876721d
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/bisect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

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

- name: Upload log
run: curl -T log.txt -X POST $WEBHOOK/?upload_log=1
env:
WEBHOOK: ${{ secrets.WEBHOOK }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "cargo-bisect-bot"
version = "0.1.0"
authors = ["bjorn3 <bjorn3@users.noreply.github.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
1 change: 1 addition & 0 deletions log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a
20 changes: 20 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use std::sync::{Arc, RwLock};

#[derive(Copy, Clone)]
pub struct Glfw;

fn fun_call<T>(val: T) -> T { val }

static mut GLFW: Option<Glfw> = None;
pub fn new() -> Result<Arc<RwLock<Glfw>>, Box<dyn std::error::Error>> {
//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)))
}

0 comments on commit 876721d

Please sign in to comment.