Skip to content

Commit e5b98a4

Browse files
committed
add CI
1 parent be542e9 commit e5b98a4

File tree

13 files changed

+320
-0
lines changed

13 files changed

+320
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---

.github/ISSUE_TEMPLATE/question.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Question
3+
about: Ask a question
4+
title: ''
5+
labels: question
6+
assignees: ''
7+
8+
---

.github/dependabot.yml

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

.github/pull_request_template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Checklist
2+
3+
Thank you for contributing to `QuestBase.jl`! Please make sure you have finished the following tasks before finishing the PR.
4+
5+
<!-- - [ ] Any code changes were done in a way that does not break public API. -->
6+
- [ ] Appropriate tests were added and tested locally by running: `make test`.
7+
- [ ] Any code changes should be `julia` formatted by running: `make format`.
8+
- [ ] All documents (in `docs/` folder) related to code changes were updated and able to build locally by running: `make docs`.
9+
<!-- - [ ] (If necessary) the `CHANGELOG.md` should be updated (regarding to the code changes) and built by running: `make changelog`. -->
10+
11+
Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a [Draft Pull Request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) to let the others know this on-going work.
12+
13+
## Description
14+
15+
Describe the proposed change here.
16+
17+
## Related issues or PRs
18+
19+
Please mention the related issues or PRs here. If the PR fixes an issue, use the keyword close/closes/closed/fix/fixes/fixed/resolve/resolves/resolved followed by the issue id, e.g. fix #[id]
20+
21+
## Additional context

.github/workflows/CI.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
branches:
7+
- 'master'
8+
pull_request:
9+
branches:
10+
- 'master'
11+
concurrency:
12+
# Skip intermediate builds: always.
13+
# Cancel intermediate builds: only if it is a pull request build.
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
16+
jobs:
17+
test:
18+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
19+
runs-on: ${{ matrix.os }}
20+
timeout-minutes: 300
21+
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
22+
actions: write
23+
contents: read
24+
strategy:
25+
matrix:
26+
version:
27+
- 'pre'
28+
- 'lts'
29+
- '1'
30+
os:
31+
- ubuntu-latest
32+
arch:
33+
- x64
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
persist-credentials: false
38+
- uses: julia-actions/setup-julia@v2
39+
with:
40+
show-versioninfo: true
41+
version: ${{ matrix.version }}
42+
arch: ${{ matrix.arch }}
43+
- uses: julia-actions/cache@v2
44+
- uses: julia-actions/julia-buildpkg@v1
45+
- uses: julia-actions/julia-runtest@v1
46+
# - uses: julia-actions/julia-processcoverage@v1
47+
# - uses: codecov/codecov-action@v4
48+
# with:
49+
# files: lcov.info
50+
# token: ${{ secrets.CODECOV_TOKEN }}
51+
# fail_ci_if_error: false
52+
# - uses: julia-actions/julia-uploadcoveralls@v1
53+
# env:
54+
# COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Cleanup Preview Documentation
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
cleanup-preview-doc:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout gh-pages branch
12+
uses: actions/checkout@v4
13+
with:
14+
ref: gh-pages
15+
- name: Delete preview and history + push changes
16+
run: |
17+
if [ -d "previews/PR$PRNUM" ]; then
18+
git config user.name "oameye"
19+
git config user.email "[email protected]"
20+
git rm -rf "previews/PR$PRNUM"
21+
git commit -m "delete preview"
22+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
23+
git push --force origin gh-pages-new:gh-pages
24+
fi
25+
env:
26+
PRNUM: ${{ github.event.number }}

.github/workflows/CompatHelper.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
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+
run: julia -e 'using CompatHelper; CompatHelper.main()'
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
branches:
8+
- 'master'
9+
pull_request:
10+
branches:
11+
- 'master'
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: write
16+
pages: write
17+
id-token: write
18+
statuses: write
19+
20+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- uses: julia-actions/setup-julia@v2
33+
with:
34+
version: 'lts'
35+
- uses: julia-actions/cache@v2
36+
- uses: julia-actions/julia-buildpkg@v1
37+
- uses: julia-actions/julia-docdeploy@v1
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
40+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
41+
JULIA_DEBUG: "Documenter"
42+
DATADEPS_ALWAYS_ACCEPT: true
43+
GKSwstype: "100" # for Plots.jl plots (if you have them)

.github/workflows/Format.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: format-check
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags: '*'
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
julia-version: [1]
16+
julia-arch: [x86]
17+
os: [ubuntu-latest]
18+
steps:
19+
- uses: julia-actions/setup-julia@latest
20+
with:
21+
version: ${{ matrix.julia-version }}
22+
23+
- uses: actions/checkout@v4
24+
- name: Install JuliaFormatter and format
25+
# This will use the latest version by default but you can set the version like so:
26+
#
27+
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
28+
run: |
29+
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
30+
julia -e 'using JuliaFormatter; format(".", verbose=true)'
31+
- name: Format check
32+
run: |
33+
julia -e '
34+
out = Cmd(`git diff`) |> read |> String
35+
if out == ""
36+
exit(0)
37+
else
38+
@error "Some files have not been formatted !!!"
39+
write(stdout, out)
40+
exit(1)
41+
end'

0 commit comments

Comments
 (0)