Skip to content

Commit 1a5b7ec

Browse files
authored
ci: Added github workflows for automated ci (#2)
* ci: Added github workflows for automated ci * ci: tweaks to ci following github testing * ci: tweak make command to install venv. Add in enforced python 3.7.17 install as seems to be installing poetry prior to python * ci: issues with last build which may be linked to use of java 17 rather than java 8. Tweaked workflow to explicitly add java to asdf management in attempt to resolve * ci: added asdf reshim in attempt to ensure correct versions of software are used * ci: adding some debug as still issues with spark session instantiation * ci: replaced asdf local with asdf set --local as different version being used on runner * ci: replaced asdf local with asdf set as different version being used on runner * ci: more debugging. Restructured asdf setup approach * ci: more debugging. Restructured asdf setup approach * ci: more debugging. export JAVA_HOME to allow correct spark session config for test step * ci: removed debugging and reenabled skipped steps * ci: attempt to run asdf install straight from .tool-versions * ci: attempt to run asdf install straight from .tool-versions * ci: use .tool-versions for asdf installs in linting and reshim prior to running of linting * ci: added black back into linting
1 parent b317891 commit 1a5b7ec

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

.github/workflows/ci_linting.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI Formatting & Linting
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
branches:
7+
- main
8+
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/checkout@v5
15+
16+
- name: Install extra dependencies for a python 3.7.17 install
17+
run: |
18+
sudo apt-get update
19+
sudo apt -y install --no-install-recommends liblzma-dev libbz2-dev libreadline-dev
20+
21+
- name: Install asdf cli
22+
uses: asdf-vm/actions/setup@v4
23+
24+
- name: Install software through asdf
25+
uses: asdf-vm/actions/install@v4
26+
27+
- name: reshim asdf
28+
run: asdf reshim
29+
30+
- name: Cache Poetry virtualenv
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.cache/pypoetry
34+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-poetry-
37+
38+
- name: Install lint dependencies
39+
run: |
40+
make install
41+
42+
- name: Run black
43+
run: poetry run black src
44+
45+
- name: Run isort
46+
run: poetry run isort src
47+
48+
- name: Run mypy
49+
run: poetry run mypy src
50+
51+
- name: Run pylint
52+
run: poetry run pylint src

.github/workflows/ci_testing.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v5
16+
17+
- name: Install extra dependencies for a python 3.7.17 install
18+
run: |
19+
sudo apt-get update
20+
sudo apt -y install --no-install-recommends liblzma-dev libbz2-dev libreadline-dev
21+
- name: Install asdf cli
22+
uses: asdf-vm/actions/setup@v4
23+
24+
- name: Install software through asdf
25+
uses: asdf-vm/actions/install@v4
26+
27+
- name: reshim asdf
28+
run: asdf reshim
29+
30+
- name: Cache Poetry virtualenv
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.cache/pypoetry
34+
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-poetry-
37+
38+
- name: Install test dependencies
39+
run: |
40+
make install
41+
42+
- name: Run pytest and coverage
43+
run: |
44+
export JAVA_HOME=$(asdf where java)
45+
echo "JAVA_HOME - $JAVA_HOME"
46+
make coverage
47+
48+
- name: Upload Coverage Report
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: coverage-xml
52+
path: coverage.xml
53+
54+
- name: Run behave tests
55+
run: |
56+
export JAVA_HOME=$(asdf where java)
57+
echo "JAVA_HOME - $JAVA_HOME"
58+
make behave

0 commit comments

Comments
 (0)