Skip to content

Commit

Permalink
feat: add Python dependencies and tests in CI (#44)
Browse files Browse the repository at this point in the history
* feat: add Python dependencies and tests in CI

* fix: correct typo

* fix: hash files

* fix: add requirements file

* fix: disable python tests for now
  • Loading branch information
ianna authored Nov 20, 2023
1 parent 790fe6a commit c46f83a
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
51 changes: 45 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
name: CI

on:
push:
branches:
- main
tags: ['*']
pull_request:

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
Expand All @@ -25,16 +28,52 @@ jobs:
- ubuntu-latest
arch:
- x64

steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1

- name: Set up Julia
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3

- name: Cache Julia dependencies
uses: julia-actions/cache@v1
with:
path: ~/.julia
key: julia-deps-${{ hashFiles('**/*.toml') }}

- name: Install Julia dependencies
run: julia -e 'import Pkg; Pkg.instantiate()'

- name: Build Julia package
uses: julia-actions/julia-buildpkg@v1

- name: Install PyCall dependencies
run: julia -e 'import Pkg; Pkg.add("PyCall"); Pkg.build("PyCall")'

- name: Run Julia tests
uses: julia-actions/julia-runtest@v1
with:
project: .

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12

- name: Install Python dependencies
run: |
python -m pip install -r requirements/pycall.txt
# - name: Run Python tests
# run: python test/test.py

- name: Generate and upload code coverage
uses: julia-actions/julia-processcoverage@v1

- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info
2 changes: 2 additions & 0 deletions requirements/pycall.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
numpy
awkward>=2.4

0 comments on commit c46f83a

Please sign in to comment.