Bongani  Ngema

Bongani Ngema

1618493700

Utilizing GitHub Actions to Build and Test on Multiple Platforms

How I built and tested a C++ application on three different platforms.

Whether you work with C, C++, Java, Python, or insert language of choice here, one thing is for certain: building and testing your project for multiple platforms is hard. Regardless of what language you use, every platform comes with nuances that to various degrees can require changes to the code we write, the build systems we implement, or both. Before you can even contemplate these issues, you need to have access to all of your target platforms in the first place!

Unfortunately for me, I had to deal with all of the aforementioned problems that I listed while working on a hobby programming project  Lamscript. The project is written in C++ and I utilize  CMake &  Make to configure, compile, and link the project on my Linux based system. While the build process I had created worked really well for Linux, I wanted to expand the project to both MacOS and Windows to make it more accessible. This is when I learned just how frustrating and complex building a project on another platform can be. While getting virtual access to either a MacOS/Windows operating system isn’t that difficult, developing a way to continuously build & test projects straight out of my codebase on to the platforms. Fortunately for me, I didn’t have to look very far to discover  GitHub Actions and it’s potential.

If you have or currently use GitHub, you’ve most likely heard of GitHub Actions. I know that I did before integrating it into Lamscript, but I didn’t fully understand it’s capabilities and how it could be useful to me. While reading through all of the documentation provided by GitHub and other developers that have used the platform to solve problems similar to what I was facing, I felt like there wasn’t documentation that just got to the point about how to use GitHub Actions and instead only focused on their specific use case. This resulted in lots of cross referencing, hours spent differentiating my expected and the actual behavior of GitHub Actions, and lots of changes to current build system to make it ready to run within a CI system like GitHub Actions and on multiple platforms. While I will be using the GitHub action config I’ve created to demonstrate some of the features of GitHub Actions, I plan to present what I’ve learned about using the tool and what I think makes it the most effective without diving into the specifics of my project. Without further ado, let me show you what I’ve done to consistently build and test Lamscript on multiple platforms with less than 100 lines of configuration.

Getting started

In order to use GitHub Actions, you must:

  1. Have a GitHub Account
  2. Have a project (public or private)

#build #github #automation #testing

What is GEEK

Buddha Community

Utilizing GitHub Actions to Build and Test on Multiple Platforms
Bongani  Ngema

Bongani Ngema

1618493700

Utilizing GitHub Actions to Build and Test on Multiple Platforms

How I built and tested a C++ application on three different platforms.

Whether you work with C, C++, Java, Python, or insert language of choice here, one thing is for certain: building and testing your project for multiple platforms is hard. Regardless of what language you use, every platform comes with nuances that to various degrees can require changes to the code we write, the build systems we implement, or both. Before you can even contemplate these issues, you need to have access to all of your target platforms in the first place!

Unfortunately for me, I had to deal with all of the aforementioned problems that I listed while working on a hobby programming project  Lamscript. The project is written in C++ and I utilize  CMake &  Make to configure, compile, and link the project on my Linux based system. While the build process I had created worked really well for Linux, I wanted to expand the project to both MacOS and Windows to make it more accessible. This is when I learned just how frustrating and complex building a project on another platform can be. While getting virtual access to either a MacOS/Windows operating system isn’t that difficult, developing a way to continuously build & test projects straight out of my codebase on to the platforms. Fortunately for me, I didn’t have to look very far to discover  GitHub Actions and it’s potential.

If you have or currently use GitHub, you’ve most likely heard of GitHub Actions. I know that I did before integrating it into Lamscript, but I didn’t fully understand it’s capabilities and how it could be useful to me. While reading through all of the documentation provided by GitHub and other developers that have used the platform to solve problems similar to what I was facing, I felt like there wasn’t documentation that just got to the point about how to use GitHub Actions and instead only focused on their specific use case. This resulted in lots of cross referencing, hours spent differentiating my expected and the actual behavior of GitHub Actions, and lots of changes to current build system to make it ready to run within a CI system like GitHub Actions and on multiple platforms. While I will be using the GitHub action config I’ve created to demonstrate some of the features of GitHub Actions, I plan to present what I’ve learned about using the tool and what I think makes it the most effective without diving into the specifics of my project. Without further ado, let me show you what I’ve done to consistently build and test Lamscript on multiple platforms with less than 100 lines of configuration.

Getting started

In order to use GitHub Actions, you must:

  1. Have a GitHub Account
  2. Have a project (public or private)

#build #github #automation #testing

Derek  Champlin

Derek Champlin

1595578080

Working with GitHub Actions

GitHub has become one of the most widely used Source Code Repository. Its Distributed Version Control System helps the developers for faster development and Integration of their code. Recently, it launched GitHub Actions in beta which enabled developers to create automated workflows to build, test, and deploy their source code on GitHub.

In this article, we will discuss about GitHub Actions and how it can be used to build an automated software development life-cycle workflow.

Below are the things we will discuss in this article:

About GitHub Actions

Using GitHub Actions, we can create custom workflows that will help to build, test, package, release or deploy the code without leaving the GitHub UI. It enables us to build Continuous integration and Continuous Deployment capabilities directly in our repository. Here are some important features about GitHub Actions.

**YAML based process: **The workflow is written in YAML. Hence it is easy to create, read and use the actions that make up the workflow.

**One Place for everything: **By using GitHub Actions, we can build and test the developed code directly in our repository. There is no need to worry about integrating the source code repository with other build and deployment tools. Everything can be done in one single place.

**Easy to integrate code: **Since enabling CI/CD directly in the repository is possible using workflows, creating merge requests(MRs), building, testing and integrating them become way more seamless.

#tech (re)view #build #cd #ci #ci-cd #github #github actions #gitlab-ci #gradle #java #test

Tamia  Walter

Tamia Walter

1596754901

Testing Microservices Applications

The shift towards microservices and modular applications makes testing more important and more challenging at the same time. You have to make sure that the microservices running in containers perform well and as intended, but you can no longer rely on conventional testing strategies to get the job done.

This is where new testing approaches are needed. Testing your microservices applications require the right approach, a suitable set of tools, and immense attention to details. This article will guide you through the process of testing your microservices and talk about the challenges you will have to overcome along the way. Let’s get started, shall we?

A Brave New World

Traditionally, testing a monolith application meant configuring a test environment and setting up all of the application components in a way that matched the production environment. It took time to set up the testing environment, and there were a lot of complexities around the process.

Testing also requires the application to run in full. It is not possible to test monolith apps on a per-component basis, mainly because there is usually a base code that ties everything together, and the app is designed to run as a complete app to work properly.

Microservices running in containers offer one particular advantage: universal compatibility. You don’t have to match the testing environment with the deployment architecture exactly, and you can get away with testing individual components rather than the full app in some situations.

Of course, you will have to embrace the new cloud-native approach across the pipeline. Rather than creating critical dependencies between microservices, you need to treat each one as a semi-independent module.

The only monolith or centralized portion of the application is the database, but this too is an easy challenge to overcome. As long as you have a persistent database running on your test environment, you can perform tests at any time.

Keep in mind that there are additional things to focus on when testing microservices.

  • Microservices rely on network communications to talk to each other, so network reliability and requirements must be part of the testing.
  • Automation and infrastructure elements are now added as codes, and you have to make sure that they also run properly when microservices are pushed through the pipeline
  • While containerization is universal, you still have to pay attention to specific dependencies and create a testing strategy that allows for those dependencies to be included

Test containers are the method of choice for many developers. Unlike monolith apps, which lets you use stubs and mocks for testing, microservices need to be tested in test containers. Many CI/CD pipelines actually integrate production microservices as part of the testing process.

Contract Testing as an Approach

As mentioned before, there are many ways to test microservices effectively, but the one approach that developers now use reliably is contract testing. Loosely coupled microservices can be tested in an effective and efficient way using contract testing, mainly because this testing approach focuses on contracts; in other words, it focuses on how components or microservices communicate with each other.

Syntax and semantics construct how components communicate with each other. By defining syntax and semantics in a standardized way and testing microservices based on their ability to generate the right message formats and meet behavioral expectations, you can rest assured knowing that the microservices will behave as intended when deployed.

Ways to Test Microservices

It is easy to fall into the trap of making testing microservices complicated, but there are ways to avoid this problem. Testing microservices doesn’t have to be complicated at all when you have the right strategy in place.

There are several ways to test microservices too, including:

  • Unit testing: Which allows developers to test microservices in a granular way. It doesn’t limit testing to individual microservices, but rather allows developers to take a more granular approach such as testing individual features or runtimes.
  • Integration testing: Which handles the testing of microservices in an interactive way. Microservices still need to work with each other when they are deployed, and integration testing is a key process in making sure that they do.
  • End-to-end testing: Which⁠—as the name suggests⁠—tests microservices as a complete app. This type of testing enables the testing of features, UI, communications, and other components that construct the app.

What’s important to note is the fact that these testing approaches allow for asynchronous testing. After all, asynchronous development is what makes developing microservices very appealing in the first place. By allowing for asynchronous testing, you can also make sure that components or microservices can be updated independently to one another.

#blog #microservices #testing #caylent #contract testing #end-to-end testing #hoverfly #integration testing #microservices #microservices architecture #pact #testing #unit testing #vagrant #vcr

Edison  Stark

Edison Stark

1603861600

How to Compare Multiple GitHub Projects with Our GitHub Stats tool

If you have project code hosted on GitHub, chances are you might be interested in checking some numbers and stats such as stars, commits and pull requests.

You might also want to compare some similar projects in terms of the above mentioned stats, for whatever reasons that interest you.

We have the right tool for you: the simple and easy-to-use little tool called GitHub Stats.

Let’s dive right in to what we can get out of it.

Getting started

This interactive tool is really easy to use. Follow the three steps below and you’ll get what you want in real-time:

1. Head to the GitHub repo of the tool

2. Enter as many projects as you need to check on

3. Hit the Update button beside each metric

In this article we are going to compare three most popular machine learning projects for you.

#github #tools #github-statistics-react #github-stats-tool #compare-github-projects #github-projects #software-development #programming

Software Testing 101: Regression Tests, Unit Tests, Integration Tests

Automation and segregation can help you build better software
If you write automated tests and deliver them to the customer, he can make sure the software is working properly. And, at the end of the day, he paid for it.

Ok. We can segregate or separate the tests according to some criteria. For example, “white box” tests are used to measure the internal quality of the software, in addition to the expected results. They are very useful to know the percentage of lines of code executed, the cyclomatic complexity and several other software metrics. Unit tests are white box tests.

#testing #software testing #regression tests #unit tests #integration tests