Skip to content

Commit

Permalink
fix: move CI from travis to git action (#527)
Browse files Browse the repository at this point in the history
* scripts folder updated

* .github folder added

* remove travis
  • Loading branch information
muzahidul-opti authored Dec 5, 2023
1 parent 26c5b02 commit 5dafc99
Show file tree
Hide file tree
Showing 20 changed files with 605 additions and 216 deletions.
88 changes: 88 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: 🐞 Bug
description: File a bug/issue
title: "[BUG] <title>"
labels: ["bug", "needs-triage"]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: SDK Version
description: Version of the SDK in use?
validations:
required: true
- type: textarea
attributes:
label: iOS Version
description: Version of iOS in use?
validations:
required: true
- type: textarea
attributes:
label: Current Behavior
description: A concise description of what you're experiencing.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1. In this environment...
1. With this config...
1. Run '...'
1. See error...
validations:
required: true
- type: textarea
attributes:
label: Link
description: Link to code demonstrating the problem.
validations:
required: false
- type: textarea
attributes:
label: Logs / Stacktraces
description: Logs/stack traces related to the problem (⚠️do not include sensitive information).
validations:
required: false
- type: dropdown
attributes:
label: Severity
description: What is the severity of the problem?
multiple: true
options:
- Blocking development
- Affecting users
- Minor issue
validations:
required: false
- type: textarea
attributes:
label: Workaround/Solution
description: Do you have any workaround or solution in mind for the problem?
validations:
required: false
- type: textarea
attributes:
label: "Recent Change"
description: Has this issue started happening after an update or experiment change?
validations:
required: false
- type: textarea
attributes:
label: Conflicts
description: Are there other libraries/dependencies potentially in conflict?
validations:
required: false
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/ENHANCEMENT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: ✨Enhancement
description: Create a new ticket for a Enhancement/Tech-initiative for the benefit of the SDK which would be considered for a minor version update.
title: "[ENHANCEMENT] <title>"
labels: ["enhancement"]
body:
- type: textarea
id: description
attributes:
label: "Description"
description: Briefly describe the enhancement in a few sentences.
placeholder: Short description...
validations:
required: true
- type: textarea
id: benefits
attributes:
label: "Benefits"
description: How would the enhancement benefit to your product or usage?
placeholder: Benefits...
validations:
required: true
- type: textarea
id: detail
attributes:
label: "Detail"
description: How would you like the enhancement to work? Please provide as much detail as possible
placeholder: Detailed description...
validations:
required: false
- type: textarea
id: examples
attributes:
label: "Examples"
description: Are there any examples of this enhancement in other products/services? If so, please provide links or references.
placeholder: Links/References...
validations:
required: false
- type: textarea
id: risks
attributes:
label: "Risks/Downsides"
description: Do you think this enhancement could have any potential downsides or risks?
placeholder: Risks/Downsides...
validations:
required: false
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE-REQUEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!--
Thanks for filing in issue! Are you requesting a new feature? If so, please share your feedback with us on the following link.
-->
## Feedback requesting a new feature can be shared [here.](https://feedback.optimizely.com/)
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: 💡Feature Requests
url: https://feedback.optimizely.com/
about: Feedback requesting a new feature can be shared here.
50 changes: 50 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Reusable action of Integration tests

on:
workflow_call:
secrets:
CI_USER_TOKEN:
required: true
TRAVIS_COM_TOKEN:
required: true

jobs:
integration_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# You should create a personal access token and store it in your repository
token: ${{ secrets.CI_USER_TOKEN }}
repository: 'optimizely/travisci-tools'
path: 'home/runner/travisci-tools'
ref: 'master'
- name: set SDK Branch if PR
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
- name: set SDK Branch if not pull request
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "SDK_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
echo "TRAVIS_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Trigger build
env:
SDK: swift
TESTAPP_TAG: master
BUILD_NUMBER: ${{ github.run_id }}
TESTAPP_BRANCH: master
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }}
EVENT_TYPE: ${{ github.event_name }}
GITHUB_CONTEXT: ${{ toJson(github) }}
#REPO_SLUG: ${{ github.repository }}
PULL_REQUEST_SLUG: ${{ github.repository }}
UPSTREAM_REPO: ${{ github.repository }}
PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }}
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
UPSTREAM_SHA: ${{ github.sha }}
TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}
EVENT_MESSAGE: ${{ github.event.message }}
HOME: 'home/runner'
run: |
home/runner/travisci-tools/trigger-script-with-status-update.sh
19 changes: 19 additions & 0 deletions .github/workflows/lint_markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Reusable action of linting markdown files

on: [workflow_call]

jobs:
lint_markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install gem and Run tests
run: |
cd ../../
gem install awesome_bot
find . -type f -name '*.md' -exec awesome_bot {} \;
20 changes: 20 additions & 0 deletions .github/workflows/source_clear_cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Source clear

on:
push:
branches: [ master ]
schedule:
# Runs "weekly"
- cron: '0 0 * * 0'

jobs:
source_clear:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Source clear scan
env:
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }}
run: |
gem install cocoapods -v '1.9.3'
curl -sSL https://download.sourceclear.com/ci.sh | bash -s - scan
94 changes: 94 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Swift

on:
push:
branches: [ 'master' ]
pull_request:
branches: [ '*' ]
workflow_dispatch:
inputs:
PREP:
required: false
type: boolean
description: prepare to release
RELEASE:
required: false
type: boolean
description: release

env:
VERSION: 3.10.2

jobs:

lint_markdown_files:
uses: optimizely/swift-sdk/.github/workflows/lint_markdown.yml@master

integration_tests:
if: "${{ github.event.inputs.PREP == '' && github.event.inputs.RELEASE == '' }}"
uses: optimizely/swift-sdk/.github/workflows/integration_tests.yml@master
secrets:
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }}
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}

lint:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 14.1.0
- env:
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }}
run: |
gem install cocoapods -v '1.9.3'
pod spec lint --quick
curl -sSL https://download.sourceclear.com/ci.sh | bash
unittests:
if: "${{ github.event.inputs.PREP == '' && github.event.inputs.RELEASE == '' }}"
uses: optimizely/swift-sdk/.github/workflows/unit_tests.yml@master

prepare_for_release:
runs-on: macos-12
if: "${{ github.event.inputs.PREP == 'true' && github.event_name == 'workflow_dispatch' }}"
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 14.1.0
- id: prepare_for_release
name: Prepare for release
env:
HOME: 'home/runner'
REPO_SLUG: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
GITHUB_USER: optibot
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }}
COCOAPODS_VERSION: '1.12.1'
run: |
gem install cocoapods -v $COCOAPODS_VERSION
Scripts/run_prep.sh
- name: Check prepare for release failure
if: steps.prepare_for_release.conclusion == 'failure'
run: cat /tmp/build.out

release:
if: "${{github.event.inputs.RELEASE == 'true' && github.event_name == 'workflow_dispatch' }}"
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 14.1.0
- name: Push to cocoapods.org
env:
HOME: 'home/runner'
REPO_SLUG: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }}
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
COCOAPODS_VERSION: '1.12.1'
run: |
gem install cocoapods -v $COCOAPODS_VERSION
Scripts/run_release.sh
16 changes: 16 additions & 0 deletions .github/workflows/ticket_reference_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Jira ticket reference check

on:
pull_request:
types: [opened, edited, reopened, synchronize]

jobs:

jira_ticket_reference_check:
runs-on: ubuntu-latest

steps:
- name: Check for Jira ticket reference
uses: optimizely/github-action-ticket-reference-checker-public@master
with:
bodyRegex: 'FSSDK-(?<ticketNumber>\d+)'
Loading

0 comments on commit 5dafc99

Please sign in to comment.