Skip to content

Commit 5841fbe

Browse files
committed
init
0 parents  commit 5841fbe

22 files changed

+601
-0
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
version: 2
4+
updates:
5+
- package-ecosystem: "github-actions"
6+
directory: "/" # Location of package manifests
7+
schedule:
8+
interval: "weekly"

.github/workflows/CompatHelper.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: '00 00 * * *'
5+
workflow_dispatch:
6+
jobs:
7+
CompatHelper:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Pkg.add("CompatHelper")
11+
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12+
- name: CompatHelper.main()
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
16+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
17+
run: julia -e 'using CompatHelper; CompatHelper.main()'

.github/workflows/TagBot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
jobs:
8+
TagBot:
9+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: JuliaRegistries/TagBot@v1
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
ssh: ${{ secrets.DOCUMENTER_KEY }}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# To workaroud https://github.com/actions/first-interaction/issues/10 in a secure way,
2+
# we take the following steps to generate and comment a performance benchmark result:
3+
# 1. first "performance tracking" workflow will generate the benchmark results in an unprivileged environment triggered on `pull_request` event
4+
# 2. then this "performance tracking (comment)" workflow will show the result to us as a PR comment in a privileged environment
5+
# Note that this workflow can only be modifed by getting checked-in to the default branch
6+
# and thus is secure even though this workflow is granted with write permissions, etc.
7+
# xref: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
8+
9+
name: Performance tracking (comment)
10+
11+
on:
12+
workflow_run:
13+
workflows:
14+
- performance tracking
15+
types:
16+
- completed
17+
18+
jobs:
19+
comment:
20+
runs-on: ubuntu-latest
21+
#runs-on: self-hosted
22+
if: >
23+
${{ github.event.workflow_run.event == 'pull_request' &&
24+
github.event.workflow_run.conclusion == 'success' }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
# restore records from the artifacts
29+
- uses: dawidd6/action-download-artifact@v11
30+
with:
31+
workflow: benchmark.yml
32+
name: performance-tracking
33+
workflow_conclusion: success
34+
- name: output benchmark result
35+
id: output-result-markdown
36+
run: |
37+
echo ::set-output name=body::$(cat ./benchmark-result.artifact)
38+
- name: output pull request number
39+
id: output-pull-request-number
40+
run: |
41+
echo ::set-output name=body::$(cat ./pull-request-number.artifact)
42+
43+
# check if the previous comment exists
44+
- name: find comment
45+
uses: peter-evans/find-comment@v3
46+
id: fc
47+
with:
48+
issue-number: ${{ steps.output-pull-request-number.outputs.body }}
49+
comment-author: 'github-actions[bot]'
50+
body-includes: Benchmark Result
51+
52+
# create/update comment
53+
- name: create comment
54+
if: ${{ steps.fc.outputs.comment-id == 0 }}
55+
uses: peter-evans/create-or-update-comment@v4
56+
with:
57+
issue-number: ${{ steps.output-pull-request-number.outputs.body }}
58+
body: ${{ steps.output-result-markdown.outputs.body }}
59+
- name: update comment
60+
if: ${{ steps.fc.outputs.comment-id != 0 }}
61+
uses: peter-evans/create-or-update-comment@v4
62+
with:
63+
comment-id: ${{ steps.fc.outputs.comment-id }}
64+
body: ${{ steps.output-result-markdown.outputs.body }}

.github/workflows/benchmark.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Performance tracking
2+
on:
3+
pull_request:
4+
5+
env:
6+
PYTHON: ~
7+
8+
jobs:
9+
performance-tracking:
10+
runs-on: ubuntu-latest
11+
#runs-on: self-hosted
12+
steps:
13+
# setup
14+
- uses: actions/checkout@v4
15+
- uses: julia-actions/setup-julia@latest
16+
with:
17+
version: '1'
18+
- uses: julia-actions/julia-buildpkg@latest
19+
- name: install dependencies
20+
run: julia -e 'using Pkg; pkg"add PkgBenchmark [email protected]"'
21+
22+
# run the benchmark suite
23+
- name: run benchmarks
24+
run: |
25+
julia -e '
26+
using BenchmarkCI
27+
BenchmarkCI.judge()
28+
BenchmarkCI.displayjudgement()
29+
'
30+
31+
# generate and record the benchmark result as markdown
32+
- name: generate benchmark result
33+
run: |
34+
body=$(julia -e '
35+
using BenchmarkCI
36+
37+
let
38+
judgement = BenchmarkCI._loadjudge(BenchmarkCI.DEFAULT_WORKSPACE)
39+
title = "Benchmark Result"
40+
ciresult = BenchmarkCI.CIResult(; judgement, title)
41+
BenchmarkCI.printcommentmd(stdout::IO, ciresult)
42+
end
43+
')
44+
body="${body//'%'/'%25'}"
45+
body="${body//$'\n'/'%0A'}"
46+
body="${body//$'\r'/'%0D'}"
47+
echo $body > ./benchmark-result.artifact
48+
49+
# record the pull request number
50+
- name: record pull request number
51+
run: echo ${{ github.event.pull_request.number }} > ./pull-request-number.artifact
52+
53+
# save as artifacts (performance tracking (comment) workflow will use it)
54+
- uses: actions/upload-artifact@v4
55+
with:
56+
name: performance-tracking
57+
path: ./*.artifact
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Changelog Enforcer"
2+
on:
3+
pull_request:
4+
# The specific activity types are listed here to include "labeled" and "unlabeled"
5+
# (which are not included by default for the "pull_request" trigger).
6+
# This is needed to allow skipping enforcement of the changelog in PRs with specific labels,
7+
# as defined in the (optional) "skipLabels" property.
8+
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
9+
10+
jobs:
11+
# Enforces the update of a changelog file on every pull request
12+
changelog:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: dangoslen/changelog-enforcer@v3
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI-nightly
2+
on:
3+
push:
4+
branches: [master, main]
5+
tags: ["*"]
6+
pull_request:
7+
8+
concurrency:
9+
# group by workflow and ref; the last slightly strange component ensures that for pull
10+
# requests, we limit to 1 concurrent job, but for the master branch we don't
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main') || github.run_number }}
12+
# Cancel intermediate builds, but only if it is a pull request build.
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
15+
env:
16+
PYTHON: ~
17+
jobs:
18+
test:
19+
name: Julia ${{ matrix.version }} - t=${{ matrix.threads }} - jet=${{ matrix.jet }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- os: ubuntu-latest
26+
arch: x64
27+
version: alpha
28+
threads: 2
29+
jet: 'false'
30+
- os: ubuntu-latest
31+
arch: x64
32+
version: '1'
33+
threads: 2
34+
jet: 'true'
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: julia-actions/install-juliaup@v2
38+
with:
39+
channel: ${{ matrix.version }}~${{ matrix.arch }}
40+
- uses: julia-actions/cache@v2
41+
- uses: julia-actions/julia-buildpkg@v1
42+
- uses: julia-actions/julia-runtest@v1
43+
env:
44+
JULIA_NUM_THREADS: ${{ matrix.threads }}
45+
JET_TEST: ${{ matrix.jet }}
46+
- uses: julia-actions/julia-processcoverage@v1
47+
- uses: codecov/codecov-action@v5
48+
with:
49+
file: lcov.info
50+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/ci.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [master, main]
5+
tags: ["*"]
6+
pull_request:
7+
8+
concurrency:
9+
# group by workflow and ref; the last slightly strange component ensures that for pull
10+
# requests, we limit to 1 concurrent job, but for the master branch we don't
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ (github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main') || github.run_number }}
12+
# Cancel intermediate builds, but only if it is a pull request build.
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
15+
env:
16+
PYTHON: ~
17+
jobs:
18+
test:
19+
name: Julia ${{ matrix.version }} - t=${{ matrix.threads }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
version:
25+
- '1'
26+
os:
27+
- ubuntu-latest
28+
- windows-latest
29+
- macos-latest
30+
threads:
31+
- '2'
32+
arch:
33+
- x64
34+
include:
35+
- arch: aarch64
36+
os: macos-latest
37+
version: '1'
38+
threads: '2'
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: julia-actions/setup-julia@v1
42+
with:
43+
version: ${{ matrix.version }}
44+
arch: ${{ matrix.arch }}
45+
- uses: julia-actions/cache@v2
46+
- uses: julia-actions/julia-buildpkg@v1
47+
- uses: julia-actions/julia-runtest@v1
48+
env:
49+
JULIA_NUM_THREADS: ${{ matrix.threads }}
50+
- uses: julia-actions/julia-processcoverage@v1
51+
- uses: codecov/codecov-action@v5
52+
with:
53+
file: lcov.info
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
docs:
56+
name: Documentation
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: julia-actions/setup-julia@v1
61+
with:
62+
version: '1'
63+
- uses: julia-actions/cache@v2
64+
- uses: julia-actions/julia-buildpkg@v1
65+
- uses: julia-actions/julia-docdeploy@v1
66+
env:
67+
GKSwstype: nul # Fix for Plots with GR backend.
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/downgrade.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Downgrade
2+
on:
3+
pull_request:
4+
branches: [master, main]
5+
paths-ignore:
6+
- 'docs/**'
7+
push:
8+
branches: [master, main]
9+
paths-ignore:
10+
- 'docs/**'
11+
env:
12+
PYTHON: ~
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
version: ['1.10']
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: julia-actions/setup-julia@v1
22+
with:
23+
version: ${{ matrix.version }}
24+
- uses: julia-actions/julia-downgrade-compat@v1
25+
with:
26+
skip: Pkg,TOML,InteractiveUtils,Random,LinearAlgebra,Statistics,Printf,Combinatorics,Random,PrecompileTools,SparseArrays,DelimitedFiles
27+
- uses: julia-actions/cache@v2
28+
- uses: julia-actions/julia-buildpkg@v1
29+
- uses: julia-actions/julia-runtest@v1

.github/workflows/invalidations.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Invalidations
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
# Skip intermediate builds: always.
8+
# Cancel intermediate builds: always.
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
evaluate:
14+
# Only run on PRs to the default branch.
15+
# In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch
16+
if: github.base_ref == github.event.repository.default_branch
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: julia-actions/setup-julia@v1
20+
with:
21+
version: '1'
22+
- uses: actions/checkout@v4
23+
- uses: julia-actions/cache@v2
24+
- uses: julia-actions/julia-buildpkg@v1
25+
- uses: julia-actions/julia-invalidations@v1
26+
id: invs_pr
27+
28+
- uses: actions/checkout@v4
29+
with:
30+
ref: ${{ github.event.repository.default_branch }}
31+
- uses: julia-actions/julia-buildpkg@v1
32+
- uses: julia-actions/julia-invalidations@v1
33+
id: invs_default
34+
35+
- name: Report invalidation counts
36+
run: |
37+
echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
38+
echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY
39+
- name: Check if the PR does increase number of invalidations
40+
if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total
41+
run: exit 1

0 commit comments

Comments
 (0)