diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..700707c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70aa0f5..b33183a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,47 +2,58 @@ name: CI on: push: - branches: "master" + branches: + - "master" + - "release-*" tags: ["*"] pull_request: release: jobs: test: - name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }} + name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} runs-on: ${{ matrix.os }} + env: + JULIA_NUM_THREADS: auto strategy: fail-fast: false matrix: julia-version: - - "1.0" + - "min" - "1" - "nightly" os: - ubuntu-latest - macos-latest julia-arch: - - x64 + - default + exclude: + - julia-version: "min" + os: macos-latest steps: - - uses: actions/checkout@v3 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v6 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.julia-version }} arch: ${{ matrix.julia-arch }} - - uses: julia-actions/cache@v1 + - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: lcov.info + continue-on-error: true Documentation: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: julia-actions/setup-julia@latest + - uses: actions/checkout@v6 + - uses: julia-actions/setup-julia@v2 with: version: 1 - - uses: julia-actions/cache@v1 + - uses: julia-actions/cache@v2 with: cache-registries: "true" - uses: julia-actions/julia-docdeploy@v1 diff --git a/Project.toml b/Project.toml index c3cb577..da1d2f3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,10 +1,10 @@ name = "OutputCollectors" uuid = "6c11c7d4-943b-4e2b-80de-f2cfc2930a8c" authors = ["Elliot Saba "] -version = "0.1.1" +version = "0.1.2" [compat] -julia = "1" +julia = "1.6" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/docs/make.jl b/docs/make.jl index 8bb73be..5e121f3 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -8,4 +8,6 @@ makedocs( deploydocs( repo = "github.com/JuliaPackaging/OutputCollectors.jl.git", push_preview = true, + devbranch = "master", + versions = ["v0.1" => "release-0.1", "v1" => "master", "v#.#"], ) diff --git a/src/OutputCollectors.jl b/src/OutputCollectors.jl index 1a32f1e..ea9b420 100644 --- a/src/OutputCollectors.jl +++ b/src/OutputCollectors.jl @@ -50,7 +50,7 @@ Given a `Pipe` that has been initialized by `spawn()`, create an async Task to read in lines as they come in and annotate the time the line was captured for later replay/merging with other simultaneously captured streams. """ -function LineStream(pipe::Pipe, event::Condition) +function LineStream(pipe::Pipe, event::Threads.Condition) # We always have to close() the input half of the stream before we can # read() from it. I don't know why, and this is honestly kind of annoying close(pipe.in) @@ -65,7 +65,7 @@ function LineStream(pipe::Pipe, event::Condition) break end push!(lines, (time(), line)) - notify(event) + Base.@lock event notify(event) end end @@ -74,7 +74,7 @@ function LineStream(pipe::Pipe, event::Condition) # being alive (e.g. `tee()`) can die alongside us gracefully as well. @async begin fetch(task) - notify(event) + Base.@lock event notify(event) end return LineStream(pipe, lines, task) end @@ -101,7 +101,7 @@ mutable struct OutputCollector P::Base.AbstractPipe stdout_linestream::LineStream stderr_linestream::LineStream - event::Condition + event::Threads.Condition tee_stream::IO verbose::Bool tail_error::Bool @@ -136,7 +136,7 @@ function OutputCollector(cmd::Base.AbstractCmd; verbose::Bool=false, end # Next, start siphoning off the first couple lines of output and error - event = Condition() + event = Threads.Condition() out_ls = LineStream(out_pipe, event) err_ls = LineStream(err_pipe, event) @@ -345,7 +345,7 @@ function tee(c::OutputCollector; colored::Bool=get_have_color(), # First thing, wait for some input. This avoids us trying to inspect # the liveliness of the linestreams before they've even started. - wait(c.event) + Base.@lock c.event wait(c.event) while alive(c.stdout_linestream) || alive(c.stderr_linestream) if length(out_lines) >= out_idx || length(err_lines) >= err_idx @@ -353,7 +353,7 @@ function tee(c::OutputCollector; colored::Bool=get_have_color(), print_next_line() else # Otherwise, wait for more input - wait(c.event) + Base.@lock c.event wait(c.event) end end