Marcelle  Smith

Marcelle Smith

1603437532

How to Automate XCTests with GitHub Actions

Ever since GitHub introduced GitHub Actions in 2018, developers now have a powerful tool to create complex pipelines for CI/CD without the need to rely on third-party software.

If you’ve worked on a project with a team composed of multiple people, you know that a lot of things can go wrong. A lot of code can break with a single commit pushed/merged by mistake or a commit made by a user who was not paying much attention to other people’s code.

The most obvious way to overcome this is to create a solid test suite that will increase in time and tell you if something is broken and needs fixing or if your code fits well with the previous code.

Tests can vary a lot, and as your project grows, your test suite will too. There are UI and unit tests, and each one of those will need to be tested on different devices with different scenarios. Who wants to wait 15 minutes for your tests to finish running? GitHub Actions are here to rescue us and will do the work.

From here on out, I’m going to use some tests from my test app that is called TestApp.

Let’s first create a .yml file that is going to contain our XCTest workflow. I’m calling it xctest-workflow.yml and it needs to be put in the .github/workflows folder in order for GitHub to recognize and execute it.

This is how the workflow is going to look:

name: iOS Test Workflow
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  build:
    name: Build and Test default scheme using iPhone/iPad simulator
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Force Xcode 11
        run: sudo xcode-select -switch /Applications/Xcode_11.7.app
      - name: iOS build setup
        run: >-
          xcodebuild test -workspace TestApp.xcodeproj/project.xcworkspace
          -scheme TestApp -destination 'platform=iOS Simulator,name=iPhone
          11,OS=13.7'
      - name: testing ... iPhone 11
        run: >-
          xcodebuild test -workspace TestApp.xcodeproj/project.xcworkspace
          -scheme TestApp -destination 'platform=iOS Simulator,name=iPhone
          11,OS=13.7'
      - name: testing ... iPhone 11 Pro Max
        run: >-
          xcodebuild test -workspace TestApp.xcodeproj/project.xcworkspace
          -scheme TestApp -destination 'platform=iOS Simulator,name=iPhone 11
          Pro Max,OS=13.7'
      - name: testing ... iPad Air
        run: >-
          xcodebuild test -workspace TestApp.xcodeproj/project.xcworkspace
          -scheme TestApp -destination 'platform=iOS Simulator,name=iPad Air
          (3rd generation),OS=13.7'
      - name: testing ... iPad Pro 12.9
        run: >-
          xcodebuild test -workspace TestApp.xcodeproj/project.xcworkspace
          -scheme TestApp -destination 'platform=iOS Simulator,name=iPad Pro (12.9-inch) (4th generation),OS=13.7'

Workflow Definition

On lines 1-8, we’re giving a name to the workflow itself and instructing that it should run every time there is a push to the master branch or a pull request has been issued on the master branch. You can add more branches or customise when you want it to run.

Check out all the possible events in the GH Actions docs.

#github #programming #developer #testing

What is GEEK

Buddha Community

How to Automate XCTests with GitHub Actions

Automating A COVID19 Report Update and Publishing with GitHub Actions

Free yourself from manual work by leveraging the power of GitHub Actions!

_This post is __part 4 _of a series of 4 publications [Project repo]**:**

  • Refer to part 1 for an overview of the series,
  • part 2_ for an explanation of the data sources and minor data cleaning,_
  • part 3_ for the creation of the visualisations, building the report and the deploy the document into ShinyApps.io and_
  • part 4_ for automatic data update, compilation and publishing of the report._

Each article in the series is self-contained, meaning that you don’t need to read the whole series to make the most out of it.

Table of Content

·  Introduction

·  Pipeline building blocks — Steps

∘  Structure of a Github Action .yml file

∘  Setup repo, R and pandoc

∘  Install dependencies

∘  Report steps — update data, run scripts, publish

∘  Publishing and secret tokens

·  When to run the pipeline — Trigger

∘  At event

∘  On schedule — using cron

·  Making your pipeline even better — Extras

∘  Cache dependencies

∘  Committing back the latest changes to your repo

#github-actions #github #automation

Desmond  Gerber

Desmond Gerber

1624347085

How to Create a Custom GitHub Actions Using JavaScript — Beginner Level

In this blog, we are going to learn how to create our own custom GitHub action using javaScript.

Prerequisite

  • Basic JavaScript Knowledge
  • Basic Git & GitHub Knowledge

About GitHub Actions

Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you’d like, including CI/CD, and combine actions in a completely customized workflow.

Types of Actions

There are three types of actions: Docker container actions, JavaScript actions, and composite run steps actions.

JavaScript Custom Action

Let’s create a Custom GitHub Action using JavaScript by creating a public repo, once the repo is created, we can clone it to our local machine using VS Code or GitPod. You need to have Node.js 12.x or higher and npm installed on your machine to perform the steps described here. You can verify the node and npm versions with the following commands in a VS Code or GitPod terminal.

node --version 
npm --version

#github #github-tutorial #github-actions #github-trend

Oral  Brekke

Oral Brekke

1618593840

Automating Your Project Processes with Github Actions

It’s common in both company and personal projects to use tools to deal with replicated tasks to improve efficiency.

This is especially true for the front-end development, because tackling with the repetitive tasks manually like building, deployment, unit testing is rather tedious and time-consuming.

This post introduces how we use Github Action to automatically deploy our front-end release in Nebula Graph.

What is Github Action

Actions are tasks that can be triggered under certain conditions. You use a series of actions to form a workflow. Detailed information refer to its  Official Documentation.

Why Github Action

There are various solutions to automated front-end deployment, then why bother switching to Github Action?

Because Github Action benefits you in the following ways:

  • It’s free.You can bind Github Action with your repository (shown in the picture below) then you can use it at once. This means you don’t have to provide machines to run the tasks or care about how the workflows are connected. You simply learn the rules before running your project. Compared with Github Action, other tools are troublesome because when implementing function A, you have to complete steps B/C/D.

#automation & #nebula graph #github actions #github

Oral  Brekke

Oral Brekke

1617445140

Terraform for GitHub Repos & Quality Tests with Github Actions

A walkthrough on setting up GitHub repositories with Terraform and a workflow to validate your Terraform files with GitHub Actions

In this blog post, we are going to leverage  Terraform’s Github provider to create a GitHub repository for a Github Organization.

Then we are going to use Github Actions and specifically the  Hashicorp setup-terraform GitHub action to run some automated validation tests on our Terraform files.

To follow along you will need:

*  HashiCorp Terraform 0.14.4 (or later)

*  A GitHub Personal Access token

Use Terraform to provision and Manage GitHub repositories and team membership

Ok, let’s see how we can leverage terraform for GitHub repos.

Creating your own repositories might be easier and faster via GitHub UI for your own projects, but in the case of Organizations with many repositories and lots of members with different access rights makes sense to actually keep your repositories configuration as code.

To begin with our example we are going to create a directory GitHub that will hold all our Terraform files related to GitHub management. Inside we are going to create 3 simple files.

#terraform #automation #infrastructure-as-code #github-actions #github

Origin Scale

Origin Scale

1620805745

Automation Management System

Want to try automated inventory management system for small businesses? Originscale automation software automate your data flow across orders, inventory, and purchasing. TRY FOR FREE

#automation #automation software #automated inventory management #automated inventory management system #automation management system #inventory automation