xref: /libCEED/.github/workflows/julia-test-with-style.yml (revision 0adbbf50dce0fd0a32cc04fdb6b3829bb2cdb133)
1dfb8ed23Sjeremyltname: Julia
23446d1b5SJeremy L Thompson
33446d1b5SJeremy L Thompsonon:
43446d1b5SJeremy L Thompson  push:
53446d1b5SJeremy L Thompson
63446d1b5SJeremy L Thompsonjobs:
73446d1b5SJeremy L Thompson  test:
83446d1b5SJeremy L Thompson    strategy:
93446d1b5SJeremy L Thompson      matrix:
106c0547c1SJeremy L Thompson        os: [ubuntu-22.04]
113446d1b5SJeremy L Thompson        julia-version: ['1']
123446d1b5SJeremy L Thompson
133446d1b5SJeremy L Thompson    runs-on: ${{ matrix.os }}
143446d1b5SJeremy L Thompson
15d83b856eSWill Pazner    env:
16d83b856eSWill Pazner      # Set `JULIA_PKG_SERVER` to the empty string so that the registry will
17d83b856eSWill Pazner      # be fetched using git instead of the package server (to avoid delays).
18d83b856eSWill Pazner      JULIA_PKG_SERVER: ""
19d83b856eSWill Pazner
203446d1b5SJeremy L Thompson    steps:
213446d1b5SJeremy L Thompson      - name: Environment setup
22*0adbbf50SJeremy L Thompson        uses: actions/checkout@v3
233446d1b5SJeremy L Thompson      - name: Julia setup
243446d1b5SJeremy L Thompson        uses: julia-actions/setup-julia@latest
253446d1b5SJeremy L Thompson        with:
263446d1b5SJeremy L Thompson          version: ${{ matrix.julia-version }}
273446d1b5SJeremy L Thompson      - name: Julia test and style
283446d1b5SJeremy L Thompson        run: |
293446d1b5SJeremy L Thompson          make info
303446d1b5SJeremy L Thompson          make -j2
31b086c2dfSWill Pazner          LIBCEED_LIB=$(find $PWD/lib -name "libceed.*")
323446d1b5SJeremy L Thompson          pushd julia/LibCEED.jl
33b086c2dfSWill Pazner          echo >> test/Project.toml
34b086c2dfSWill Pazner          echo "[preferences.libCEED_jll]" >> test/Project.toml
35b086c2dfSWill Pazner          echo "libceed_path = \"$LIBCEED_LIB\"" >> test/Project.toml
36b086c2dfSWill Pazner          [[ "$GITHUB_REF" =~ ^refs/(heads/release|tags/).* ]] || julia --project -e 'import Pkg; Pkg.test("LibCEED"; coverage=true, test_args=["--run-dev-tests"])'
37b086c2dfSWill Pazner          git checkout test/Project.toml && julia --project -e 'import Pkg; Pkg.test("LibCEED")'
383446d1b5SJeremy L Thompson          julia --project=.style/ -e 'import Pkg; Pkg.instantiate()' && julia --project=.style/ .style/ceed_style.jl && git diff --exit-code src test examples
39