-
Notifications
You must be signed in to change notification settings - Fork 51
Refactoring Pull Request CI #599
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
Open
paul-gerber-svg
wants to merge
30
commits into
eclipse-basyx:develop
Choose a base branch
from
rwth-iat:ref/ci
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
6a6bb7a
CI: Test Reduce Action Run and Cache
paul-gerber-svg 494380b
Trigger CI run
paul-gerber-svg 7199b59
Extend Caching to All Python Installations
paul-gerber-svg 53f5201
Test Concurrent Runs
hpoeche a615403
clean up after concurrency test
hpoeche cb7f464
remove caching for compliance-tool-package job
hpoeche 8f1eac9
Fix Schema curl call
paul-gerber-svg 9fe445e
Test docker image for all server variants
hpoeche 19063c8
Test server liveness through API call
hpoeche 05f25e9
ci: remove redundancies and add small fixes
paul-gerber-svg 89b132d
ci: fix setup-python SHA hash
paul-gerber-svg f4cdff5
Fix Python actions hashes for node.js support
paul-gerber-svg fcfbdc4
CI: extend python version check to Dockerfiles
hpoeche 0344def
test Dockerfile version check
hpoeche b64da2e
Revert "test Dockerfile version check"
hpoeche bbd244e
CI: Replace Pycodestyle with Ruff Linting
paul-gerber-svg 7410982
Introduce composite action for docker building
hpoeche f41d418
Fix: Checkout before composite action
hpoeche efbf66f
Fix: image naming in build-server action
hpoeche 0f57dc8
Fix image-ref of build-server action
hpoeche 8c345b5
Introduce arm64 docker tests
hpoeche 7e74f09
Fix arm docker test
hpoeche ec5da7f
Update and versions with hashes
paul-gerber-svg a0eec0c
Enable arm docker tests only for pr on main
hpoeche 2045913
Use `build-server` action in release
hpoeche 79bfd99
Align naming of docker jobs and parameters
hpoeche 60f242d
Add missing line at the end of the file
s-heppner 68e10c8
Add missing line at the end of the file
s-heppner abaeeb5
Fix arm-docker-test
hpoeche ada8012
Add Comment to to justify PyCodestyle usage
paul-gerber-svg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| name: build-server | ||
| description: Sets up the build context and builds a docker image | ||
| inputs: | ||
| server-profile: | ||
| required: true | ||
| description: The profile of the server to build (discovery, registry, repository) | ||
| load: | ||
| required: false | ||
| description: Set to "true" to use image in further steps (only works for single architecture builds) | ||
| default: "false" | ||
| platform: | ||
| required: false | ||
| description: The target platforms to build the image for | ||
| default: "linux/amd64" | ||
| publish: | ||
| required: false | ||
| description: Set to "true" to publish image to Docker Hub (requires login) | ||
| default: "false" | ||
|
|
||
| outputs: | ||
| image-ref: | ||
| description: Reference to the locally-runnable image (valid if load="true") | ||
| value: ${{ steps.naming.outputs.image-name }}:${{ steps.naming.outputs.local-tag }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Setup QEMU | ||
| uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 #v4.2.0 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c #v4.2.0 | ||
|
|
||
| - name: Generate Image Title | ||
| id: naming | ||
| shell: bash | ||
| run: | | ||
| profile="${{ inputs.server-profile }}" | ||
| echo "profile-title=${profile^}" >> "$GITHUB_OUTPUT" | ||
| echo "image-name=eclipsebasyx/basyx-python-${{ inputs.server-profile }}" >> $GITHUB_OUTPUT | ||
| echo "local-tag=ci-${{ github.run_id }}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Extract Docker image metadata | ||
| id: meta | ||
| uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 #v6.2.0 | ||
| with: | ||
| images: ${{ steps.naming.outputs.image-name }} | ||
| # This fetches the latest git tag and adds an additional "latest" to it, so e.g. `2.1.0,latest` | ||
| tags: | | ||
| type=semver,pattern={{version}} | ||
| type=raw,value=latest,enable=${{ inputs.publish == 'true' && true || false }} | ||
| type=raw,value=${{ steps.naming.outputs.local-tag }},enable=${{ inputs.load == 'true' && true || false }} | ||
| labels: | | ||
| org.opencontainers.image.title=BaSyx Python ${{ steps.naming.outputs.profile-title }} Service | ||
| org.opencontainers.image.description=Eclipse BaSyx Python SDK - ${{ steps.naming.outputs.profile-title }} HTTP Server | ||
| org.opencontainers.image.source=https://github.com/eclipse-basyx/basyx-python-sdk/tree/main/server | ||
| org.opencontainers.image.licenses=MIT | ||
|
|
||
| - name: Build Docker Image | ||
| id: build | ||
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a #v7.3.0 | ||
| with: | ||
| context: . | ||
| file: ./server/docker/${{ inputs.server-profile }}/Dockerfile | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| platforms: ${{ inputs.platform }} | ||
| push: ${{ inputs.publish == 'true' && true || false }} | ||
| load: ${{ inputs.load == 'true' && true || false }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: main.yml | ||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| X_API_VERSION: "v3.1" | ||
|
|
||
| jobs: | ||
| server-docker-arm: | ||
| # This job checks if we can build our server package | ||
| runs-on: ubuntu-24.04-arm | ||
| strategy: | ||
| matrix: | ||
| profile: [ "repository", "discovery", "registry" ] | ||
| fail-fast: false | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 #v5.1.0 | ||
|
|
||
| - uses: ./.github/actions/build-server | ||
| id: build | ||
| with: | ||
| server-profile: ${{ matrix.profile }} | ||
| load: true | ||
| publish: false | ||
| platform: linux/arm64 | ||
| - name: Run container | ||
| run: | | ||
| docker run -d --name basyx-python-${{ matrix.profile }} -p 9080:80 --pull=never ${{ steps.build.outputs.image-ref }} | ||
| - name: Wait for container and server initialization | ||
| run: | | ||
| timeout 30s bash -c ' | ||
| until docker logs basyx-python-${{ matrix.service }} 2>&1 | grep -q "INFO success: quit_on_failure entered RUNNING state"; do | ||
| sleep 2 | ||
| done | ||
| ' | ||
| - name: Check if service is alive | ||
| run: | | ||
| curl -f http://localhost:9080/api/${{ env.X_API_VERSION }}/description | ||
| - name: Stop and remove the container | ||
| run: | | ||
| docker stop basyx-python-${{ matrix.profile }} && docker rm basyx-python-${{ matrix.profile }} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.