Skip to content

Commit

Permalink
New workflow for PRs (#587)
Browse files Browse the repository at this point in the history
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
## Description
This PR removes CircleCI workflow configurations for automated release
and arm image builds and replaces them with github actions. We now have
5 workflows:

1. build_php_docker_image: Builds and pushes docker image for php in arm
and amd architectures. Runs on develop, master,release candidates and on
pushed tags
2. build_port_drayage_docker_image: Builds and pushed docker image for
port drayage webservice in arm and amd architectures .Runs on develop,
master,release candidates and on pushed tags
3. build_v2xhub_docker_image: Builds and pushed docker image for v2xhub
in arm and amd architectures .Runs on develop, master,release candidates
and on pushed tags
4. pull_request: Builds all docker images in arm and amd (no push)
architectures. Runs only on pull requests
5. sonar_scanner: Builds source code, runs unit tests and runs static
analysis (sonar scanner) and pushes results. Runs on develop, master and
on all open PRs.

<!--- Describe your changes in detail -->

## Related Issue
VH-1278
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context
Remove CircleCI and use platform/architecture for docker images
<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?
@jwilliammartin  Could you test the following on ARM devices.
docker compose pull and run new images. Ensure no docker images crash on
both V2X-Hub and Port Drayage web UI are accessible.
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Defect fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the **CONTRIBUTING** document.
[V2XHUB Contributing
Guide](https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/Contributing.md)
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
  • Loading branch information
paulbourelly999 authored Mar 26, 2024
1 parent fb65791 commit 24d6989
Show file tree
Hide file tree
Showing 11 changed files with 207 additions and 237 deletions.
109 changes: 0 additions & 109 deletions .circleci/config.yml

This file was deleted.

106 changes: 0 additions & 106 deletions .github/workflows/build.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/build_php_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build PHP V2X-Hub Web UI
on:
push:
branches:
- develop
- master
- 'release/**'
# Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags )
tags:
- '*'
jobs:
v2xhub-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: usdotfhwaops/php
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
file: ./docker/Dockerfile-php
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_ARCHITECTURE=${{ matrix.architecture }}
UBUNTU_CODENAME=${{ matrix.ubuntu-codename }}
48 changes: 48 additions & 0 deletions .github/workflows/build_port_drayage_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build Port Drayage Web Service
on:
push:
branches:
- develop
- master
- 'release/**'
# Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags )
tags:
- '*'
jobs:
v2xhub-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: usdotfhwaops/port-drayage-webservice
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
context: ./tools/port-drayage-webservice/
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_ARCHITECTURE=${{ matrix.architecture }}
UBUNTU_CODENAME=${{ matrix.ubuntu-codename }}
47 changes: 47 additions & 0 deletions .github/workflows/build_v2xhub_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build V2X-Hub Docker Image
on:
push:
branches:
- develop
- master
- 'release/**'
# Build all tags not containing a / (https://stackoverflow.com/questions/61891328/trigger-github-action-only-on-new-tags )
tags:
- '*'
jobs:
v2xhub-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: usdotfhwaops/v2xhub
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_ARCHITECTURE=${{ matrix.architecture }}
UBUNTU_CODENAME=${{ matrix.ubuntu-codename }}
Loading

0 comments on commit 24d6989

Please sign in to comment.