From e286ec0b664245d44171be0044805a619eaa9a6f Mon Sep 17 00:00:00 2001 From: Anchal Gupta Date: Mon, 22 Jul 2024 13:41:01 -0700 Subject: [PATCH] Using reusable workflows; remove dev from trigger * 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. --- .github/workflows/compat_helper.yml | 21 ++++------- .github/workflows/format_check.yml | 35 +++--------------- .github/workflows/make_docs.yml | 43 ++++------------------ .github/workflows/test.yml | 55 ++++++++--------------------- docs/make.jl | 2 +- 5 files changed, 33 insertions(+), 123 deletions(-) diff --git a/.github/workflows/compat_helper.yml b/.github/workflows/compat_helper.yml index 7296886..91501c4 100644 --- a/.github/workflows/compat_helper.yml +++ b/.github/workflows/compat_helper.yml @@ -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 diff --git a/.github/workflows/format_check.yml b/.github/workflows/format_check.yml index 31363c3..98cc8b2 100644 --- a/.github/workflows/format_check.yml +++ b/.github/workflows/format_check.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/make_docs.yml b/.github/workflows/make_docs.yml index 757ac29..11be24c 100644 --- a/.github/workflows/make_docs.yml +++ b/.github/workflows/make_docs.yml @@ -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 \ No newline at end of file + uses: ProjectTorreyPines/GitHubActionsWorkflows/.github/workflows/make_docs.yml@master \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2d5b4d..02ee337 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 \ No newline at end of file + 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. \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index 4740ba7..0f4a3b2 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -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#.#"], )