From 938bf216e52bd7aaadac101b385a4905dbb0ccca Mon Sep 17 00:00:00 2001 From: Anton Reinhard Date: Fri, 24 Nov 2023 19:20:05 +0100 Subject: [PATCH] Improve actions workflow by removing prepare step (#23) Reviewed-on: https://code.woubery.com/Rubydragon/MetagraphOptimization.jl/pulls/23 Co-authored-by: Anton Reinhard Co-committed-by: Anton Reinhard --- .gitea/workflows/julia-package-ci.yml | 125 ++------------------------ 1 file changed, 9 insertions(+), 116 deletions(-) diff --git a/.gitea/workflows/julia-package-ci.yml b/.gitea/workflows/julia-package-ci.yml index 85d0cf2..10cf859 100644 --- a/.gitea/workflows/julia-package-ci.yml +++ b/.gitea/workflows/julia-package-ci.yml @@ -7,64 +7,7 @@ env: JULIA_DEPOT_PATH: './.julia' jobs: - prepare: - runs-on: ubuntu-22.04 - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Julia environment - uses: https://github.com/julia-actions/setup-julia@v1.9.2 - with: - version: '1.9.2' - - # needed for the file hashing, should be removed when ${{ hashFiles('**/Project.toml') }} is supported in gitea - - name: Setup go environment - uses: actions/setup-go@v3 - with: - go-version: '1.20' - - - name: Hash files - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 - id: get-hash - with: - patterns: |- - **/Project.toml - - - name: Restore Cache - uses: actions/cache/restore@v3 - id: cache-restore - with: - path: | - .julia/artifacts - .julia/packages - .julia/registries - key: julia-${{ steps.get-hash.outputs.hash }} - - - name: Check cache hit - if: steps.cache-restore.outputs.cache-hit == 'true' - run: exit 0 - - - name: Install dependencies - run: | - julia --project=./ -e 'import Pkg; Pkg.instantiate(); Pkg.precompile()' - julia --project=examples/ -e 'import Pkg; Pkg.develop(Pkg.PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()' - julia --project=docs/ -e 'import Pkg; Pkg.develop(Pkg.PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()' - - - name: Cache Julia packages - uses: actions/cache/save@v3 - with: - path: | - .julia/artifacts - .julia/packages - .julia/registries - key: julia-${{ steps.get-hash.outputs.hash }} - test: - needs: prepare runs-on: ubuntu-22.04 steps: @@ -78,33 +21,8 @@ jobs: with: version: '1.9.2' - # needed for the file hashing, should be removed when ${{ hashFiles('**/Project.toml') }} is supported in gitea - - name: Setup go environment - uses: actions/setup-go@v3 - with: - go-version: '1.20' - - - name: Hash files - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 - id: get-hash - with: - patterns: |- - **/Project.toml - - - name: Restore cached Julia packages - uses: actions/cache/restore@v3 - with: - path: | - .julia/artifacts - .julia/packages - .julia/registries - key: julia-${{ steps.get-hash.outputs.hash }} - - - name: Install dependencies - run: | - julia --project=./ -e 'import Pkg; Pkg.instantiate(); Pkg.precompile()' - julia --project=examples/ -e 'import Pkg; Pkg.develop(Pkg.PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()' - julia --project=docs/ -e 'import Pkg; Pkg.develop(Pkg.PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()' + - name: Instantiate + run: julia --project=./ -e 'using Pkg; Pkg.instantiate()' - name: Format check run: | @@ -120,13 +38,14 @@ jobs: end' - name: Run tests - run: julia --project=./ -t 4 -e 'import Pkg; Pkg.test()' -O0 + run: julia --project=./ -t 4 -e 'using Pkg; Pkg.test()' -O0 - name: Run examples - run: julia --project=examples/ -t 4 -e 'include("examples/import_bench.jl")' -O3 + run: | + julia --project=examples/ -e 'using Pkg; Pkg.develop(Pkg.PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()' + julia --project=examples/ -t 4 -e 'include("examples/import_bench.jl")' -O3 docs: - needs: prepare runs-on: ubuntu-22.04 steps: @@ -140,36 +59,10 @@ jobs: with: version: '1.9.2' - # needed for the file hashing, should be removed when ${{ hashFiles('**/Project.toml') }} is supported in gitea - - name: Setup go environment - uses: actions/setup-go@v3 - with: - go-version: '1.20' - - - name: Hash files - uses: https://gitea.com/actions/go-hashfiles@v0.0.1 - id: get-hash - with: - patterns: |- - **/Project.toml - - - name: Restore cached Julia packages - uses: actions/cache/restore@v3 - with: - path: | - .julia/artifacts - .julia/packages - .julia/registries - key: julia-${{ steps.get-hash.outputs.hash }} - - - name: Install dependencies - run: | - julia --project=./ -e 'import Pkg; Pkg.instantiate(); Pkg.precompile()' - julia --project=examples/ -e 'import Pkg; Pkg.develop(Pkg.PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()' - julia --project=docs/ -e 'import Pkg; Pkg.develop(Pkg.PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()' - - name: Build docs - run: julia --project=docs/ docs/make.jl + run: | + julia --project=docs/ -e 'using Pkg; Pkg.develop(Pkg.PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.precompile()' + julia --project=docs/ docs/make.jl - name: Upload artifacts uses: actions/upload-artifact@v3