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

Release 0.9.1 #10

Merged
merged 30 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d2a4586
Separate test for debs; Bump version to 0.9.1
asorbini Apr 15, 2024
c831a31
Clone repository during deb build
asorbini Apr 15, 2024
25915a9
Don't cancel parallel jobs
asorbini Apr 15, 2024
1ca6286
Debug failing workflow
asorbini Apr 15, 2024
40a0861
Trying to get container log printed out
asorbini Apr 15, 2024
222bbe7
Trying to get container log printed out
asorbini Apr 15, 2024
c19105e
Install dependencies to run integration test
asorbini Apr 15, 2024
33678b4
Install dependencies to run integration test
asorbini Apr 15, 2024
a09a5db
Fix int-test bug
asorbini Apr 15, 2024
ff5e763
Capture container logs
asorbini Apr 15, 2024
e7c0b2e
Make runner executable
asorbini Apr 15, 2024
9a94280
Clean up pull request workflows after closing them
asorbini Apr 15, 2024
47f4507
fix error in test
asorbini Apr 15, 2024
751edd1
Use runner.debug to increase verbosity; fix full-validation runner al…
asorbini Apr 15, 2024
3c0a3b4
Consistent testing invocation through makefile
asorbini Apr 16, 2024
bc8c417
Makefile improvements
asorbini Apr 16, 2024
d21b8a2
Don't use poetry in automation
asorbini Apr 16, 2024
c1a5ba3
Debug updated workflows
asorbini Apr 16, 2024
e53dd48
Avoid duplicate arg
asorbini Apr 16, 2024
b840ca1
Debug updated workflows
asorbini Apr 16, 2024
44e6b4f
pytest not being picked up
asorbini Apr 16, 2024
4dfc8e5
Don't update changelog in local deb builds
asorbini Apr 16, 2024
e130222
Debugging
asorbini Apr 16, 2024
a5377f6
DEBUGGING
asorbini Apr 16, 2024
1c9fea1
DEBUGGING
asorbini Apr 16, 2024
a43c94f
Fix deb build
asorbini Apr 16, 2024
63407a2
Fix deb build
asorbini Apr 16, 2024
4892b80
Don't resolve runner
asorbini Apr 16, 2024
5f98c47
Use different artifact names based on use of license; enable masquera…
asorbini Apr 16, 2024
5584c6c
info logs for experiment
asorbini Apr 16, 2024
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
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.*
venv
poetry.lock

build
134 changes: 88 additions & 46 deletions .github/workflows/_deb_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,18 @@ concurrency:
permissions:
packages: read

env:
DEBUG: y
VERBOSITY: debug

jobs:
config:
runs-on: ubuntu-latest
outputs:
BUILDER_TAG: ${{ steps.config.outputs.BUILDER_TAG }}
REF_TAG: ${{ steps.config.outputs.REF_TAG }}
DEB_ARTIFACT: ${{ steps.config.outputs.DEB_ARTIFACT }}
DEB_BUILDER_TAG: ${{ steps.config.outputs.DEB_BUILDER_TAG }}
RUNNER: ${{ steps.config.outputs.RUNNER }}
TEST_IMAGE: ${{ steps.config.outputs.TEST_IMAGE }}
TEST_ARTIFACT: ${{ steps.config.outputs.TEST_ARTIFACT }}
TEST_DATE: ${{ steps.config.outputs.TEST_DATE }}
TEST_ID: ${{ steps.config.outputs.TEST_ID }}
TEST_IMAGE: ${{ steps.config.outputs.TEST_IMAGE }}
TEST_RUNNER_ARTIFACT: ${{ steps.config.outputs.TEST_RUNNER_ARTIFACT }}
steps:
- name: Clone uno
uses: actions/checkout@v4
Expand All @@ -61,16 +60,31 @@ jobs:
runner='["self-hosted", "linux", "arm64", "rpi5"]'
;;
esac
builder_tag=$(echo ${{inputs.base-tag}} | tr : - | tr / -)
ref_tag=$(echo ${{ github.ref_name }} | tr / -)
test_id=$(date +%Y%m%d-%H%M%S)
test_artifact=uno-test-deb-${builder_tag}-${ref_tag}-${{inputs.platform}}__${test_id}
case "${{github.ref_type}}" in
tag)
image_version=${{github.ref_name}}
;;
*)
sha_short=$(cd src/uno && git rev-parse --short HEAD)
image_version=${{github.ref_name}}@${sha_short}
;;
esac
image_version="$(echo ${image_version} | tr / -)"
deb_builder_tag=$(echo ${{inputs.base-tag}} | tr : - | tr / -)
test_date=$(date +%Y%m%d-%H%M%S)
test_id=deb-${deb_builder_tag}-${{ inputs.platform }}__${image_version}
test_artifact=uno-test-${test_id}__${test_date}
test_runner_artifact=uno-runner-${deb_builder_tag}-${{ inputs.platform }}__${image_version}__${test_date}
deb_artifact=uno-deb-${deb_builder_tag}-${{ inputs.platform }}__${image_version}__${test_date}
(
echo RUNNER=${runner}
echo BUILDER_TAG=${builder_tag}
echo REF_TAG=${ref_tag}
echo TEST_IMAGE=mentalsmash/uno-test-runner:latest
echo DEB_BUILDER_TAG=${deb_builder_tag}
echo DEB_ARTIFACT=${deb_artifact}
echo TEST_ARTIFACT=${test_artifact}
echo TEST_DATE=${test_date}
echo TEST_ID=${test_id}
echo TEST_IMAGE=mentalsmash/uno-test-runner:latest
echo TEST_RUNNER_ARTIFACT=${test_runner_artifact}
) >> ${GITHUB_OUTPUT}

build-packages:
Expand All @@ -83,14 +97,6 @@ jobs:
path: src/uno
submodules: true

- name: Clone support files
uses: actions/checkout@v4
with:
repository: mentalsmash/uno-ci
token: ${{ secrets.UNO_CI_PAT }}
ref: master
path: src/uno-ci

- name: Log in to GitHub
uses: docker/login-action@v3
with:
Expand All @@ -103,23 +109,75 @@ jobs:
make -C src/uno changelog
make -C src/uno debuild
env:
DEB_BUILDER: ghcr.io/mentalsmash/uno-ci-debian-builder:${{ needs.config.outputs.BUILDER_TAG }}
DEB_BUILDER: ghcr.io/mentalsmash/uno-ci-debian-builder:${{ needs.config.outputs.DEB_BUILDER_TAG }}

- name: Upload debian packages
uses: actions/upload-artifact@v4
with:
name: uno-${{inputs.platform}}-${{needs.config.outputs.BUILDER_TAG}}
name: ${{ needs.config.outputs.DEB_ARTIFACT }}
path: src/uno/debian-dist/*
if: always()

- name: Upload test runner
uses: actions/upload-artifact@v4
with:
name: ${{ needs.config.outputs.TEST_RUNNER_ARTIFACT }}
path: src/uno/dist/bundle/default/runner

- name: Fix permissions
run: |
docker run --rm \
-v $(pwd)/src/uno:/uno \
ghcr.io/mentalsmash/uno-ci-debian-builder:${{ needs.config.outputs.BUILDER_TAG }} \
ghcr.io/mentalsmash/uno-ci-debian-builder:${{ needs.config.outputs.DEB_BUILDER_TAG }} \
chown -R $(id -u):$(id -g) /uno
if: always()

test-packages:
needs:
- config
- build-packages
runs-on: ${{ fromJson(needs.config.outputs.RUNNER) }}
env:
DEB_TESTER: ${{ needs.config.outputs.TEST_IMAGE }}
FIX_DIR: ${{ github.workspace }}
RTI_LICENSE_FILE: ${{ github.workspace }}/src/uno-ci/resource/rti/rti_license.dat
TEST_DATE: ${{ needs.config.outputs.TEST_DATE }}
TEST_ID: ${{ needs.config.outputs.TEST_ID }}
TEST_IMAGE: ${{ needs.config.outputs.TEST_IMAGE }}
steps:
- name: Clone uno
uses: actions/checkout@v4
with:
path: src/uno
submodules: true

- name: Clone support files
uses: actions/checkout@v4
with:
repository: mentalsmash/uno-ci
token: ${{ secrets.UNO_CI_PAT }}
ref: master
path: src/uno-ci

- name: Download runner artifact
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.config.outputs.TEST_RUNNER_ARTIFACT }}

- name: Download debian packages artifact
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.config.outputs.DEB_ARTIFACT }}

- name: Move artifacts in place
run: |
mkdir -p src/uno/dist/bundle/default/runner
mv -v ${{ needs.config.outputs.TEST_RUNNER_ARTIFACT }}/* \
src/uno/dist/bundle/default/runner/

mkdir -p src/uno/debian-dist
mv -v ${{ needs.config.outputs.DEB_ARTIFACT }}/* \
src/uno/debian-dist/

- name: Build tester image
uses: docker/build-push-action@v5
with:
Expand All @@ -130,38 +188,22 @@ jobs:
build-args: |
BASE_IMAGE=${{ inputs.base-tag }}

- name: Setup integration tests
run: |
python3 -m venv venv
. venv/bin/activate
pip3 install -U pip setuptools
pip3 install -U -e src/uno
cp src/uno-ci/resource/rti/rti_license.dat rti_license.dat

- name: Run integration tests
run: |
. venv/bin/activate
pytest -s -v --junit-xml=test-results/uno-test-results-integration-${{ needs.config.outputs.REF_TAG }}.xml \
src/uno/test/integration
make -C src/uno debtest
env:
DEV: y
RTI_LICENSE_FILE: ${{ github.workspace }}/rti_license.dat
TEST_IMAGE: ${{ needs.config.outputs.TEST_IMAGE }}
TEST_RUNNER: runner
DEBUG: ${{ runner.debug }}

- name: Restore permissions changed by integration tests
if: always()
run: |
docker run --rm \
-v $(pwd):/workspace \
${{ needs.config.outputs.TEST_IMAGE }} \
fix-root-permissions $(id -u):$(id -g) /workspace
make -C src/uno fix-file-ownership

# Always collect and upload available test results
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: ${{ needs.config.outputs.TEST_ARTIFACT }}
path: test-results/*
path: src/uno/test-results/*
if: always()

6 changes: 3 additions & 3 deletions .github/workflows/_install_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ jobs:
src/uno/test/install

- name: Restore permissions changed by tests
if: ${{ always() }}
if: always()
run: |
docker run --rm \
-v $(pwd):/workspace \
${{inputs.tag}} \
fix-root-permissions $(id -u):$(id -g) /workspace
fix-file-ownership $(id -u):$(id -g) /workspace

- name: Upload test results
uses: actions/upload-artifact@v4
if: ${{ always() }}
if: always()
with:
name: ${{ needs.test-config.outputs.TEST_ARTIFACT }}
path: test-results/*
16 changes: 8 additions & 8 deletions .github/workflows/_release_badges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ jobs:
version=${sha_short}
color_version=orange
tag=nightly
badge_default_version=29b57b0427def87cc3ef4ab81c956c29
badge_default_base=2d53344e1ccfae961665e08432f18113
badge_static_version=d73e338805c7d2c348a2d7149a66f66c
badge_static_base=373e55438055b1222c9937797c949f9b
badge_default_version=e7aab205f782cc0c6f394a2fece90509
badge_default_base=8f31c46dcfd0543b42f356e5b1c6c2c8
badge_static_version=b310f08c34f051846877aeb59b0be311
badge_static_base=b0e38a84eb8679d5212e162fbb616773
;;
tag)
version=${{github.ref_name}}
color_version=green
tag=latest
badge_default_version=e7aab205f782cc0c6f394a2fece90509
badge_default_base=8f31c46dcfd0543b42f356e5b1c6c2c8
badge_static_version=b310f08c34f051846877aeb59b0be311
badge_static_base=b0e38a84eb8679d5212e162fbb616773
badge_default_version=29b57b0427def87cc3ef4ab81c956c29
badge_default_base=2d53344e1ccfae961665e08432f18113
badge_static_version=d73e338805c7d2c348a2d7149a66f66c
badge_static_base=373e55438055b1222c9937797c949f9b
;;
esac
(
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/_release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,9 @@ jobs:
path: src/uno
submodules: true

- name: Bootstrap dev dependencies with poetry
run: |
python3 -m venv poetry-venv
. poetry-venv/bin/activate
pip install -U poetry
deactivate
cd src/uno
${GITHUB_WORKSPACE}/poetry-venv/bin/poetry install --with=dev

- name: Validate code
run: |
. src/uno/.venv/bin/activate
ruff check

- name: Validate code format
run: |
. src/uno/.venv/bin/activate
ruff format --check
make -C src/uno code-check

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
Loading