Skip to content

Commit 67e5469

Browse files
committed
refresh the CI a bit
1 parent 1fff45f commit 67e5469

7 files changed

Lines changed: 112 additions & 89 deletions

File tree

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/CompatHelper.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ jobs:
3737
- name: "Run CompatHelper"
3838
run: |
3939
import CompatHelper
40-
CompatHelper.main(master_branch="develop")
40+
CompatHelper.main()
4141
shell: julia --color=yes {0}
4242
env:
4343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44-
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/ci.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- master
7+
pull_request:
78

89
jobs:
910
test:
@@ -13,36 +14,30 @@ jobs:
1314
fail-fast: false
1415
matrix:
1516
version:
16-
- 'nightly'
17+
- '1' # This is always the latest stable release in the 1.X series
18+
- '1.10' # LTS
19+
#- 'nightly'
1720
os:
1821
- ubuntu-latest
19-
- macOS-latest
22+
#- macOS-latest
2023
#- windows-latest
2124
arch:
2225
- x64
2326
steps:
24-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v4
2528
- uses: julia-actions/setup-julia@v1
2629
with:
2730
version: ${{ matrix.version }}
2831
arch: ${{ matrix.arch }}
29-
- uses: actions/cache@v1
30-
env:
31-
cache-name: cache-artifacts
32-
with:
33-
path: ~/.julia/artifacts
34-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
35-
restore-keys: |
36-
${{ runner.os }}-test-${{ env.cache-name }}-
37-
${{ runner.os }}-test-
38-
${{ runner.os }}-
32+
- uses: julia-actions/cache@v2
3933
- uses: julia-actions/julia-buildpkg@latest
4034
- run: |
4135
git config --global user.name Tester
4236
git config --global user.email te@st.er
4337
- uses: julia-actions/julia-runtest@latest
4438
continue-on-error: ${{ matrix.version == 'nightly' }}
4539
- uses: julia-actions/julia-processcoverage@v1
46-
- uses: codecov/codecov-action@v1
40+
- uses: codecov/codecov-action@v4
4741
with:
48-
file: lcov.info
42+
files: lcov.info
43+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/docker.yml

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,40 @@
1-
name: Publish Docker image
1+
2+
name: build docker image
23

34
on:
45
push:
5-
tags:
6-
- "v*"
7-
release:
8-
types: [published, created]
6+
branches:
7+
- master
8+
tags: '*'
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: lcsb-biocore/gigasom.jl # lowercase of ${{ github.repository }}
913

1014
jobs:
11-
push_to_registry:
12-
name: Push Docker image to GitHub Packages
15+
build:
1316
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
1420
steps:
15-
- name: Check out the repo
16-
uses: actions/checkout@v2
17-
- name: Push to GitHub Registry
18-
uses: mr-smithers-excellent/docker-build-push@v5
19-
with:
20-
image: gigasom.jl
21-
tags: latest
22-
registry: ghcr.io
23-
username: cylon-x
24-
password: ${{ secrets.docker_token }}
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: log into docker registry
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
- name: extract metadata
30+
id: meta
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
34+
- name: build and push the docker container
35+
uses: docker/build-push-action@v6
36+
with:
37+
context: .
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/docs.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1+
12
# ref: https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#GitHub-Actions-1
23
name: Documentation
34

45
on:
6+
pull_request:
57
push:
68
branches:
7-
- develop
89
- master
910
tags: '*'
10-
release:
11-
types: [published, created]
1211

1312
jobs:
1413
build:
1514
runs-on: ubuntu-latest
1615
steps:
17-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v4
1817
- uses: julia-actions/setup-julia@latest
19-
with:
20-
version: 1.7
18+
- uses: julia-actions/cache@v2
2119
- name: Install dependencies
22-
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
20+
run: julia --color=yes --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
2321
- name: Build and deploy
2422
env:
2523
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
26-
run: julia --project=docs/ docs/make.jl
24+
run: julia --color=yes --project=docs/ docs/make.jl

.github/workflows/pr-format.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
on:
2+
pull_request:
3+
issue_comment:
4+
types: [created]
5+
6+
name: Formatting
7+
8+
jobs:
9+
formatting:
10+
if: github.event_name == 'pull_request' || (github.event_name == 'issue_comment' && github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'OWNER' || github.event.issue.user.id == github.event.comment.user.id) && startsWith(github.event.comment.body, '/format') )
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Clone the repository
14+
uses: actions/checkout@v4
15+
- name: Checkout the pull request code # this checks out the actual branch so that one can commit into it
16+
if: github.event_name == 'issue_comment'
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
run: |
20+
gh pr checkout ${{ github.event.issue.number }}
21+
- name: Install JuliaFormatter and format
22+
run: |
23+
julia --color=yes -e 'import Pkg; Pkg.add("JuliaFormatter")'
24+
julia --color=yes -e 'using JuliaFormatter; format(".")'
25+
- name: Remove trailing whitespace
26+
run: |
27+
find -name '*.jl' -or -name '*.md' -or -name '*.toml' -or -name '*.yml' | while read filename ; do
28+
# remove any trailing spaces
29+
sed --in-place -e 's/\s*$//' "$filename"
30+
# add a final newline if missing
31+
if [[ -s "$filename" && $(tail -c 1 "$filename" |wc -l) -eq 0 ]] ; then
32+
echo >> "$filename"
33+
fi
34+
# squash superfluous final newlines
35+
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' "$filename"
36+
done
37+
- name: Fail on formatting problems
38+
if: github.event_name == 'pull_request'
39+
run: |
40+
if git diff --exit-code --quiet
41+
then echo "Looks OK"
42+
else echo "Formatting fixes required!"; git diff -p ; exit 1
43+
fi
44+
- name: Commit fixes
45+
if: github.event_name == 'issue_comment'
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
run: |
49+
if [ `git status -s | wc -l` -ne 0 ] ; then
50+
git config --local user.name "$GITHUB_ACTOR"
51+
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
52+
git commit -a -m "automatic formatting" -m "triggered by @$GITHUB_ACTOR on PR #${{ github.event.issue.number }}"
53+
if git push
54+
then gh pr comment ${{ github.event.issue.number }} --body \
55+
":heavy_check_mark: Auto-formatting triggered by [this comment](${{ github.event.comment.html_url }}) succeeded, commited as `git rev-parse HEAD`"
56+
else gh pr comment ${{ github.event.issue.number }} --body \
57+
":x: Auto-formatting triggered by [this comment](${{ github.event.comment.html_url }}) failed, perhaps someone pushed to the PR in the meantime?"
58+
fi
59+
else
60+
gh pr comment ${{ github.event.issue.number }} --body \
61+
":sunny: Auto-formatting triggered by [this comment](${{ github.event.comment.html_url }}) succeeded, but the code was already formatted correctly."
62+
fi

0 commit comments

Comments
 (0)