Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SnoopCompileBot #2832

Merged
merged 20 commits into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/SnoopCompile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: SnoopCompile

on:
push:
branches:
# - 'master' # NOTE: to run the bot only on pushes to master

defaults:
run:
shell: bash

jobs:
SnoopCompile:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
env:
GKS_ENCODING: "utf8"
GKSwstype: "100"
PLOTS_TEST: "true"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version: # NOTE: the versions below should match those in your botconfig
- '1.3'
- '1.4'
- '1.5.0-rc1'
- 'nightly'
os: # NOTE: should match the os setting of your botconfig
- ubuntu-latest
- windows-latest
- macos-latest
arch:
- x64
steps:
# Setup environment
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
- name: Install dependencies
run: |
julia --project -e 'using Pkg; Pkg.instantiate();'
julia -e 'using Pkg; Pkg.add(PackageSpec(url = "https://github.com/timholy/SnoopCompile.jl")); Pkg.develop(PackageSpec(; path=pwd())); using SnoopCompile; SnoopCompile.addtestdep();'
# TESTCMD
- name: Default TESTCMD
run: echo ::set-env name=TESTCMD::"julia"
- name: Ubuntu TESTCMD
if: startsWith(matrix.os,'ubuntu')
run: echo ::set-env name=TESTCMD::"xvfb-run julia"
# Generate precompile files
- name: Generating precompile files
run: $TESTCMD --project -e 'include("deps/SnoopCompile/snoop_bot.jl")' # NOTE: must match path
# Run benchmarks
- name: Running Benchmark
run: $TESTCMD --project -e 'include("deps/SnoopCompile/snoop_bench.jl")' # NOTE: optional, if have benchmark file
- name: Upload all
uses: actions/upload-artifact@v2
with:
path: ./

Create_PR:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
needs: SnoopCompile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download all
uses: actions/download-artifact@v2
- name: Move the content of the directory to the root
run: |
rsync -a artifact/* ./
rm -d -r artifact
- name: Discard unrelated changes
run: |
test -f 'Project.toml' && git checkout -- 'Project.toml'
git ls-files 'Manifest.toml' | grep . && git checkout -- 'Manifest.toml'
(git diff -w --no-color || git apply --cached --ignore-whitespace && git checkout -- . && git reset && git add -p) || echo done
- name: Format precompile_includer.jl
run: julia -e 'using Pkg; Pkg.add("JuliaFormatter"); using JuliaFormatter; format_file("src/precompile_includer.jl")'
- name: Create Pull Request
# https://github.com/marketplace/actions/create-pull-request
uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update precompile_*.jl file
# committer: Daniel Schwabender <daschw@disroot.org> # NOTE: change `committer` to your name and your email.
title: "[AUTO] Update precompiles"
labels: SnoopCompile
branch: "SnoopCompile_AutoPR"


Skip:
if: "contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- name: Skip CI 🚫
run: echo skip ci
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
if: startsWith(matrix.os,'ubuntu')
run: echo ::set-env name=TESTCMD::"xvfb-run julia"

# Julia Deoendencies
# Julia Dependencies
- name: Install Julia dependencies
uses: julia-actions/julia-buildpkg@latest

Expand Down
4 changes: 4 additions & 0 deletions deps/SnoopCompile/precompile_script.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using Plots

Plots.test_examples(:gr, skip = Plots._backend_skips[:gr])
Plots.test_examples(:plotly, skip = Plots._backend_skips[:plotly], disp = false)
11 changes: 11 additions & 0 deletions deps/SnoopCompile/snoop_bench.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using SnoopCompile

snoop_bench(
BotConfig(
"Plots",
yml_path= "SnoopCompile.yml",
else_os = "linux",
else_version = "1.4",
),
joinpath(@__DIR__, "precompile_script.jl"),
)
11 changes: 11 additions & 0 deletions deps/SnoopCompile/snoop_bot.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using SnoopCompile

snoop_bot(
BotConfig(
"Plots",
yml_path= "SnoopCompile.yml",
else_os = "linux",
else_version = "1.4",
),
joinpath(@__DIR__, "precompile_script.jl"),
)
55 changes: 0 additions & 55 deletions deps/generateprecompiles.jl

This file was deleted.

3 changes: 0 additions & 3 deletions src/Plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,4 @@ end

const CURRENT_BACKEND = CurrentBackend(:none)

include("precompile.jl")
_precompile_()

end # module
Loading