Skip to content

Commit

Permalink
Fix: run python formatting in gha inside venv (faasm#273)
Browse files Browse the repository at this point in the history
* fix(gha): run python formatting in gha inside venv

* fix(gha): improve the defaults configuration in gha

* fix(dist-tests): use venv in dist-tests' build internal
  • Loading branch information
csegarragonz authored Oct 4, 2022
1 parent d7fce1d commit be18960
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

defaults:
run:
working-directory: /code/faabric
shell: bash

jobs:
Expand All @@ -17,9 +18,6 @@ jobs:
runs-on: ubuntu-latest
container:
image: faasm/faabric:0.3.5
defaults:
run:
working-directory: /code/faabric
steps:
- uses: faasm/conan-cache-action@v1
with:
Expand All @@ -32,9 +30,6 @@ jobs:
runs-on: ubuntu-latest
container:
image: faasm/faabric:0.3.5
defaults:
run:
working-directory: /code/faabric
steps:
- name: "Fetch ref"
run: git fetch origin ${GITHUB_REF}:ci-branch
Expand All @@ -48,18 +43,21 @@ jobs:
runs-on: ubuntu-latest
container:
image: faasm/faabric:0.3.5
defaults:
run:
working-directory: /code/faabric
steps:
# --- Code update ---
- name: "Fetch ref"
run: git fetch origin ${GITHUB_REF}:ci-branch
- name: "Check out branch"
run: git checkout --force ci-branch
- name: "Update python deps"
run: |
source venv/bin/activate
pip3 install -r requirements.txt
# --- Formatting checks ---
- name: "Python formatting check"
run: ./bin/check_python.sh
run: |
source venv/bin/activate
./bin/check_python.sh
- name: "Run C/C++ formatting"
run: ./bin/run_clang_format.sh
- name: "Check C/C++ formatting changes"
Expand All @@ -83,9 +81,6 @@ jobs:
container:
image: faasm/faabric:0.3.5
options: --privileged
defaults:
run:
working-directory: /code/faabric
services:
redis:
image: redis
Expand All @@ -109,6 +104,9 @@ jobs:
runs-on: ubuntu-latest
env:
CONAN_CACHE_MOUNT_SOURCE: ~/.conan/
defaults:
run:
working-directory: ${{ github.workspace }}
steps:
# --- Code update ---
- name: "Check out code"
Expand All @@ -132,9 +130,6 @@ jobs:
REDIS_STATE_HOST: redis
container:
image: faasm/faabric:0.3.5
defaults:
run:
working-directory: /code/faabric
services:
redis:
image: redis
Expand Down
3 changes: 3 additions & 0 deletions dist-test/build_internal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ set -e
export PROJ_ROOT=$(dirname $(dirname $(readlink -f $0)))
pushd ${PROJ_ROOT} >> /dev/null

# Activate the Python venv
source ./bin/workon.sh

# Run the debug build
inv dev.cmake --build=Debug
inv dev.cc faabric_dist_tests
Expand Down

0 comments on commit be18960

Please sign in to comment.