DEV Community

Cover image for Working with Github Actions CI Workflow - Swift Programming
Japneet Singh
Japneet Singh

Posted on • Edited on

3

Working with Github Actions CI Workflow - Swift Programming

Introduction

To set up Github Actions CI Workflow for swift. You will be required to visit your repository on GitHub.

  1. On GitHub.com, navigate to the main page of the repository.
  2. Under your repository name, click Actions. Image description
  3. If you already have a workflow in your repository, click New workflow.
  4. Find the template that you want to use, then click Set up this workflow. Image description
name: Swift

    on:
     push:
     branches: [ main ]
     pull_request:
     branches: [ main ]

    jobs:
     build:

     runs-on: macos-latest

     steps:
     - uses: actions/checkout@v2
     - name: Build
     run: swift build -v
     - name: Run tests
     run: swift test -v
Enter fullscreen mode Exit fullscreen mode

Working on other repo

Successful GitHub action workflow on pull request.
Workflow #

Image description
I worked on CI for testing on javascript using jest. This testing function would allow to check if css stylesheet is passed.

test("should be able to pass specified style", () => {
        expect(
            checkGenPageArgsWithCSS(
                data,
                data.texts,
                data.title,
                data.stylesheet,
            ),
        ).argv_s = `<link rel="stylesheet" type="text/css" href="please_add_your_css_path" />`;
    });
Enter fullscreen mode Exit fullscreen mode

GITHUB PR

Conclusion

All in all, CI enables Organizations to scale their engineering teams, codebases, and infrastructure. It enables each team member to take ownership of a new code change from conception to completion. This will help you to be the rightful owner for the code to be tested before release.

Sentry mobile image

Mobile Vitals: A first step to Faster Apps

Slow startup times, UI hangs, and frozen frames frustrate users—but they’re also fixable. Mobile Vitals help you measure and understand these performance issues so you can optimize your app’s speed and responsiveness. Learn how to use them to reduce friction and improve user experience.

Read the guide →

Top comments (0)

Sentry growth stunted Image

If you are wasting time trying to track down the cause of a crash, it’s time for a better solution. Get your crash rates to zero (or close to zero as possible) with less time and effort.

Try Sentry for more visibility into crashes, better workflow tools, and customizable alerts and reporting.

Switch Tools

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay