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'
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
_This post is __part 4 _of a series of 4 publications [Project repo]**:**
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.
· 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
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.
node --version npm --version
#github #github-tutorial #github-actions #github-trend
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.
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.
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:
#automation & #nebula graph #github actions #github
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
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