Skip to content

Commit 3d67677

Browse files
Updating further actions to devcontainer
1 parent d19392d commit 3d67677

2 files changed

Lines changed: 30 additions & 41 deletions

File tree

.github/workflows/consumer_test.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,33 @@ jobs:
3131
- name: Checkout PR
3232
uses: actions/checkout@v4.2.2
3333

34-
- name: Prepare Python
35-
run: |
36-
bazel run //:ide_support
3734

38-
- name: Prepare report directory
39-
run: |
40-
mkdir -p reports
35+
- name: Build and run dev container task
36+
uses: devcontainers/ci@v0.3
37+
with:
38+
cacheFrom: ghcr.io/eclipse-score/devcontainer@v1.2.0
39+
push: never
40+
# The pipefail ensures that non 0 exit codes inside the pytest execution get carried into the pipe
41+
# & make the tests red in the end. Without this we only would check the exit code of the 'tee' command.
42+
runCmd: |
43+
set -euxo pipefail
4144
42-
# The pipefail ensures that non 0 exit codes inside the pytest execution get carried into the pipe
43-
# & make the tests red in the end. Without this we only would check the exit code of the 'tee' command.
44-
- name: Run Consumer tests
45+
# Prepare Python
46+
pip install -r src/requirements.txt
4547
46-
run: |
47-
set -o pipefail
48-
.venv_docs/bin/python -m pytest -s -vv src/tests/ --repo="$CONSUMER" --junitxml="reports/${{ matrix.consumer }}.xml" | tee "reports/${{ matrix.consumer }}.log"
49-
env:
50-
FORCE_COLOR: "1"
51-
TERM: xterm-256color
52-
PYTHONUNBUFFERED: "1"
53-
CONSUMER: ${{ matrix.consumer }}
48+
# Prepare report directory
49+
mkdir -p reports
50+
51+
# Run tests for this matrix consumer
52+
export FORCE_COLOR="1"
53+
export TERM="xterm-256color"
54+
export PYTHONUNBUFFERED="1"
55+
export CONSUMER="${{ matrix.consumer }}"
56+
57+
pytest -s -v src/tests/ \
58+
--repo="$CONSUMER" \
59+
--junitxml="reports/${{ matrix.consumer }}.xml" \
60+
| tee "reports/${{ matrix.consumer }}.log"
5461
5562
- name: Upload consumer test report
5663
if: ${{ always() }}

.github/workflows/test.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,17 @@ on:
1919
jobs:
2020
code:
2121
runs-on: ubuntu-latest
22-
container:
23-
image: ghcr.io/eclipse-score/devcontainer:v1.2.0
2422
steps:
25-
- name: Checkout repository
26-
uses: actions/checkout@v4.2.2
27-
- name: Cache Bazel and pip
28-
uses: actions/cache@v4
23+
- name: Build and run dev container task
24+
uses: devcontainers/ci@v0.3
2925
with:
30-
path: |
31-
~/.cache/bazel
32-
~/.cache/pip
33-
key: ${{ runner.os }}-test-${{ hashFiles('**/*.bazel', '**/BUILD', '**/*.bzl', 'src/requirements.txt', 'src/**/*.py') }}
34-
35-
- name: Setup Bazel with cache
36-
uses: bazel-contrib/setup-bazel@0.15.0
37-
with:
38-
disk-cache: true
39-
repository-cache: true
40-
bazelisk-cache: true
41-
- name: Run test targets
42-
run: |
43-
WS="$GITHUB_WORKSPACE"
44-
su -l vscode -c "
45-
cd '$WS'
26+
cacheFrom: ghcr.io/eclipse-score/devcontainer@v1.2.0
27+
push: never
28+
runCmd: |
4629
bazel run //:ide_support
4730
bazel test //src/...
48-
"
4931
50-
- name: Prepare bundled consumer report
32+
- name: Prepare bundled test report
5133
if: always()
5234
# Creating tests-report directory
5335
# Follow Symlinks via '-L' to copy correctly

0 commit comments

Comments
 (0)