DEV Community

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

Posted on • Updated on

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.

Top comments (0)