Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test tree artefact #205

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 71 additions & 63 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,79 +3,87 @@ name: CI
on: [ pull_request ]

jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: 'poetry'
- name: Install dependencies
run: poetry install --no-interaction --no-root
- run: source .venv/bin/activate
- uses: pre-commit/[email protected]
# pre-commit:
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v4
# - uses: snok/install-poetry@v1
# with:
# virtualenvs-create: true
# virtualenvs-in-project: true
# installer-parallel: true
# - uses: actions/setup-python@v5
# with:
# python-version: "3.10"
# cache: 'poetry'
# - name: Install dependencies
# run: poetry install --no-interaction --no-root
# - run: source .venv/bin/activate
# - uses: pre-commit/[email protected]
#
# fast-tests:
# runs-on: ubuntu-22.04
# needs: [ pre-commit ]
# steps:
# - uses: actions/checkout@v4
# - name: Unit tests
# run: ./scripts/unit_tests.sh
# - name: Execute Mypy
# run: ./scripts/mypy.sh
# - name: Build aspect integration tests
# run: |
# cd test/aspect
# bazel build //...
# - name: Build examples
# run: |
# cd examples
# bazel build //...

fast-tests:
integration-tests-aspect-linux:
runs-on: ubuntu-22.04
needs: [ pre-commit ]
steps:
- uses: actions/checkout@v4
- name: Unit tests
run: ./scripts/unit_tests.sh
- name: Execute Mypy
run: ./scripts/mypy.sh
- name: Build aspect integration tests
- name: Integration tests - Aspect
run: |
cd test/aspect
bazel build //...
- name: Build examples
run: |
cd examples
bazel build //...
./execute_tests.py -t tree_artifact -b 7.0.0 -p 3.11.6 -v

integration-tests-aspect:
runs-on: ubuntu-22.04
needs: [ fast-tests ]
integration-tests-aspect-macos:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Integration tests - Aspect
run: |
cd test/aspect
./execute_tests.py
./execute_tests.py -t tree_artifact -b 7.0.0 -p 3.11.6 -v

integration-tests-apply-fixes:
runs-on: ubuntu-22.04
needs: [ fast-tests ]
steps:
- run: |
mkdir --parents /tmp/bin
wget --no-verbose https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-linux-amd64 -O /tmp/bin/buildozer
chmod +x /tmp/bin/buildozer
- uses: actions/checkout@v4
- name: Integration tests - Applying fixes
run: |
export PATH=/tmp/bin:$PATH
./test/apply_fixes/execute_tests.py

integration-tests-examples:
strategy:
matrix:
os: [ ubuntu-22.04, macos-12, windows-2022 ]
runs-on: ${{ matrix.os }}
needs: [ fast-tests ]
steps:
- uses: actions/checkout@v4
- name: Integration tests - Examples
run: |
cd examples
python test.py
- name: Integration tests - Examples with legacy WORKSPACE setup
run: |
cd examples
python test.py --legacy-workspace
# integration-tests-apply-fixes:
# runs-on: ubuntu-22.04
# needs: [ fast-tests ]
# steps:
# - run: |
# mkdir --parents /tmp/bin
# wget --no-verbose https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-linux-amd64 -O /tmp/bin/buildozer
# chmod +x /tmp/bin/buildozer
# - uses: actions/checkout@v4
# - name: Integration tests - Applying fixes
# run: |
# export PATH=/tmp/bin:$PATH
# ./test/apply_fixes/execute_tests.py
#
# integration-tests-examples:
# strategy:
# matrix:
# os: [ ubuntu-22.04, macos-12, windows-2022 ]
# runs-on: ${{ matrix.os }}
# needs: [ fast-tests ]
# steps:
# - uses: actions/checkout@v4
# - name: Integration tests - Examples
# run: |
# cd examples
# python test.py
# - name: Integration tests - Examples with legacy WORKSPACE setup
# run: |
# cd examples
# python test.py --legacy-workspace
6 changes: 3 additions & 3 deletions src/aspect/dwyu.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ def dwyu_aspect_impl(target, ctx):
defines = _gather_defines(ctx, target_compilation_context = target[CcInfo].compilation_context),
output_path = "{}_processed_target_under_inspection.json".format(target.label.name),
is_target_under_inspection = True,
verbose = False,
verbose = True,
)

target_deps, target_impl_deps = _preprocess_deps(ctx)

# TODO Investigate if we can prevent running this multiple times for the same dep if multiple
# target_under_inspection have the same dependency
processed_deps = _process_dependencies(ctx, target = target, deps = target_deps, verbose = False)
processed_impl_deps = _process_dependencies(ctx, target = target, deps = target_impl_deps, verbose = False)
processed_deps = _process_dependencies(ctx, target = target, deps = target_deps, verbose = True)
processed_impl_deps = _process_dependencies(ctx, target = target, deps = target_impl_deps, verbose = True)

report_file = ctx.actions.declare_file("{}_dwyu_report.json".format(target.label.name))
args = ctx.actions.args()
Expand Down
1 change: 1 addition & 0 deletions test/aspect/tree_artifact/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ create_tree_artifacts(
private_headers = "private_hdrs.h",
public_headers = "public_hdrs.h",
sources = "sources.cc",
verbose = True,
)

cc_library(
Expand Down
Loading