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 CI time - non hermetic #200

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
128 changes: 64 additions & 64 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,78 @@ 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/action@v3.0.0

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 //...

integration-tests-aspect:
runs-on: ubuntu-22.04
needs: [ fast-tests ]
steps:
- uses: actions/checkout@v4
- name: Integration tests - Aspect
run: |
cd test/aspect
./execute_tests.py

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
# 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/action@v3.0.0
#
# 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 //...
#
# integration-tests-aspect:
# runs-on: ubuntu-22.04
# needs: [ fast-tests ]
# steps:
# - uses: actions/checkout@v4
# - name: Integration tests - Aspect
# run: |
# cd test/aspect
# ./execute_tests.py
#
# 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 ]
# needs: [ fast-tests ]
steps:
- uses: actions/checkout@v4
- name: Integration tests - Examples
run: |
cd examples
python test.py
# - name: Integration tests - Examples
# run: |
# cd examples
# python test.py
- name: Integration tests - Examples with legacy WORKSPACE setup
run: |
cd examples
Expand Down
7 changes: 6 additions & 1 deletion examples/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# When working with hermetic Python toolchains, supporting the legacy runfiles layout is needlessly wasting resources.
# See https://github.com/bazelbuild/rules_python/issues/1653
common --nolegacy_external_runfiles
# common --nolegacy_external_runfiles

# The symlinks are annoying
common --experimental_convenience_symlinks=clean
Expand All @@ -12,3 +12,8 @@ common --experimental_convenience_symlinks=clean
# However, there are several open issues suggesting the lock file will change in one way or another.
# Thus, we don't use the bzlmod locking yet.
common --lockfile_mode=off

# Easier to use host python in legacy system
common --noenable_bzlmod

common --spawn_strategy=local
34 changes: 17 additions & 17 deletions examples/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ setup_step_2()
# executing the examples as integration test.
#

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

maybe(
http_archive,
name = "rules_python",
sha256 = "9acc0944c94adb23fba1c9988b48768b1bacc6583b52a2586895c5b7491e2e31",
strip_prefix = "rules_python-0.27.0",
urls = ["https://github.com/bazelbuild/rules_python/releases/download/0.27.0/rules_python-0.27.0.tar.gz"],
)

load("@rules_python//python:repositories.bzl", "python_register_toolchains")

python_register_toolchains(
name = "python",
python_version = "3.8",
)
#load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
#load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

#maybe(
# http_archive,
# name = "rules_python",
# sha256 = "9acc0944c94adb23fba1c9988b48768b1bacc6583b52a2586895c5b7491e2e31",
# strip_prefix = "rules_python-0.27.0",
# urls = ["https://github.com/bazelbuild/rules_python/releases/download/0.27.0/rules_python-0.27.0.tar.gz"],
#)
#
#load("@rules_python//python:repositories.bzl", "python_register_toolchains")
#
#python_register_toolchains(
# name = "python",
# python_version = "3.8",
#)