xref: /libCEED/.github/workflows/julia-test-with-style.yml (revision ef9a992f4cf09f2be4ec72f649495c67ec03f813)
1dfb8ed23Sjeremyltname: Julia
23446d1b5SJeremy L Thompson
33446d1b5SJeremy L Thompsonon:
43446d1b5SJeremy L Thompson  push:
5dcd9f19cSJeremy L Thompson    branches:
6dcd9f19cSJeremy L Thompson      - main
7dcd9f19cSJeremy L Thompson  pull_request:
83446d1b5SJeremy L Thompson
93446d1b5SJeremy L Thompsonjobs:
103446d1b5SJeremy L Thompson  test:
113446d1b5SJeremy L Thompson    strategy:
123446d1b5SJeremy L Thompson      matrix:
13*d83cf49fSJeremy L Thompson        os: [ubuntu-24.04]
143446d1b5SJeremy L Thompson        julia-version: ['1']
153446d1b5SJeremy L Thompson
163446d1b5SJeremy L Thompson    runs-on: ${{ matrix.os }}
173446d1b5SJeremy L Thompson
18d83b856eSWill Pazner    env:
19d83b856eSWill Pazner      # Set `JULIA_PKG_SERVER` to the empty string so that the registry will
20d83b856eSWill Pazner      # be fetched using git instead of the package server (to avoid delays).
21d83b856eSWill Pazner      JULIA_PKG_SERVER: ""
22d83b856eSWill Pazner
233446d1b5SJeremy L Thompson    steps:
243446d1b5SJeremy L Thompson      - name: Environment setup
25e735508cSJeremy L Thompson        uses: actions/checkout@v4
263446d1b5SJeremy L Thompson      - name: Julia setup
273446d1b5SJeremy L Thompson        uses: julia-actions/setup-julia@latest
283446d1b5SJeremy L Thompson        with:
293446d1b5SJeremy L Thompson          version: ${{ matrix.julia-version }}
303446d1b5SJeremy L Thompson      - name: Julia test and style
313446d1b5SJeremy L Thompson        run: |
323446d1b5SJeremy L Thompson          make info
333446d1b5SJeremy L Thompson          make -j2
34b086c2dfSWill Pazner          LIBCEED_LIB=$(find $PWD/lib -name "libceed.*")
353446d1b5SJeremy L Thompson          pushd julia/LibCEED.jl
36b086c2dfSWill Pazner          echo >> test/Project.toml
37b086c2dfSWill Pazner          echo "[preferences.libCEED_jll]" >> test/Project.toml
38b086c2dfSWill Pazner          echo "libceed_path = \"$LIBCEED_LIB\"" >> test/Project.toml
39b086c2dfSWill Pazner          [[ "$GITHUB_REF" =~ ^refs/(heads/release|tags/).* ]] || julia --project -e 'import Pkg; Pkg.test("LibCEED"; coverage=true, test_args=["--run-dev-tests"])'
40b086c2dfSWill Pazner          git checkout test/Project.toml && julia --project -e 'import Pkg; Pkg.test("LibCEED")'
413446d1b5SJeremy L Thompson          julia --project=.style/ -e 'import Pkg; Pkg.instantiate()' && julia --project=.style/ .style/ceed_style.jl && git diff --exit-code src test examples
42