Skip to content

Commit

Permalink
Using reusable workflows; remove dev from trigger
Browse files Browse the repository at this point in the history
* Using reusable workflows from [GitHubActionsWorkflows](https://github.com/ProjectTorreyPines/GitHubActionsWorkflows)
* Remove dev from trigger list; from now on we'll directly merge with master as package versions are on registry
* Online documentation of development version will be made from master branch now.
  • Loading branch information
anchal-physics committed Jul 22, 2024
1 parent 48d2f6e commit e286ec0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 123 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/compat_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,12 @@ name: CompatHelper
on:
schedule:
- cron: '37 3 * * *'
push:
branches: reuse_ci
paths:
- '.github/workflows/format_check.yml'
- 'Project.toml'
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: "Add the FuseRegistry via Git"
run: |
using Pkg
Pkg.Registry.add(RegistrySpec(url="https://github.com/ProjectTorreyPines/FuseRegistry.jl.git"))
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main(;master_branch="master")'
uses: ProjectTorreyPines/GitHubActionsWorkflows/.github/workflows/compat_helper.yml@master
35 changes: 4 additions & 31 deletions .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,15 @@ name: Format Check

on:
push:
branches: ["master", "dev", "format"]
branches: ["master", "reuse_ci"]
paths:
- '.github/workflows/format_check.yml'
- '**.jl'
pull_request:
branches: ["master", "dev"]
branches: ["master"]
paths:
- '.github/workflows/format_check.yml'
- '**.jl'
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.x]
julia-arch: [x64]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}

- uses: actions/checkout@v1
- name: Install JuliaFormatter and format
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- uses: julia-actions/cache@v1
- name: Format check
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'
format_check:
uses: ProjectTorreyPines/GitHubActionsWorkflows/.github/workflows/format_check.yml@master
43 changes: 7 additions & 36 deletions .github/workflows/make_docs.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,20 @@
name: Make Docs
on:
pull_request:
branches: ["master", "dev"]
push:
branches: ["master", "reuse_ci"]
paths:
- '.github/workflows/make_docs.yml'
- 'src/**'
- 'docs/**'
push:
branches:
- master
- dev
- docs
tags: '*'
pull_request:
branches: ["master"]
paths:
- '.github/workflows/make_docs.yml'
- 'src/**'
- 'docs/**'
tags: '*'
workflow_dispatch:

permissions:
actions: write
contents: write
statuses: write


jobs:
make_docs:
name: Documentation
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.x]
julia-arch: [x64]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
- uses: julia-actions/cache@v1
- name: "Add the FuseRegistry via Git"
run: |
julia --project=docs/ -e 'using Pkg; Pkg.Registry.add(RegistrySpec(url="https://github.com/ProjectTorreyPines/FuseRegistry.jl.git")); Pkg.Registry.add("General")'
- name: Install dependencies
run: |
julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
run: julia --project=docs/ docs/make.jl
uses: ProjectTorreyPines/GitHubActionsWorkflows/.github/workflows/make_docs.yml@master
55 changes: 15 additions & 40 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,32 @@ name: Test

on:
push:
branches: ["master", "dev", "autotest"]
branches: ["master", "reuse_ci"]
paths:
- '.github/workflows/test.yml'
- 'src/**'
- 'test/**'
- 'Project.toml'
pull_request:
branches: ["master", "dev"]
branches: ["master"]
paths:
- '.github/workflows/test.yml'
- 'src/**'
- 'test/**'
- 'Project.toml'

permissions:
actions: write
contents: read

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.x]
julia-arch: [x64]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- uses: actions/checkout@v4
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: |
${{ secrets.SOLPSTESTSAMPLES_SSH_KEY}}
${{ secrets.DVC_SSH_KEY }}
- name: Configure ssh
run: |
echo "${{ secrets.DVC_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
echo "${{ secrets.DVC_SSH_CONFIG }}" >> ~/.ssh/config
- uses: iterative/setup-dvc@v1
- name: DVC Pull
run: |
dvc pull
- uses: julia-actions/cache@v1
- name: "Add the FuseRegistry via Git"
run: |
julia --project=. -e 'using Pkg; Pkg.Registry.add(RegistrySpec(url="https://github.com/ProjectTorreyPines/FuseRegistry.jl.git")); Pkg.Registry.add("General")'
- uses: julia-actions/julia-runtest@v1
# Not set up yet
# - uses: julia-actions/julia-processcoverage@v1
# - uses: codecov/codecov-action@v4
# with:
# files: lcov.info
uses: ProjectTorreyPines/GitHubActionsWorkflows/.github/workflows/test.yml@master
secrets: inherit
# Optional inputs for artifact uploading
# For example, uncomment the following 4 lines to upload test result images that
# will be generated by test/runtests.jl in test directory
# with:
# upload_artifact: true
# artifact_name: test_result_images
# artifact_path: test/*.png
# Optional input to diable use of dvc for downloading sample files
# with:
# use_dvc: false
# secrets: inherit can be removed in this case.
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ deploydocs(;
repo="github.com/ProjectTorreyPines/SD4SOLPS.jl.git",
target="build",
branch="gh-pages",
devbranch="dev",
devbranch="master",
versions=["stable" => "v^", "v#.#"],
)

0 comments on commit e286ec0

Please sign in to comment.