From 39b7edd1ccec3c115dace76c858caa1214ce27ef Mon Sep 17 00:00:00 2001 From: Yasir Ali Date: Wed, 20 Apr 2022 12:50:11 +0500 Subject: [PATCH] Suggested changes made. --- .github/workflows/integration_tests.yml | 11 +------- .github/workflows/lint_markdown.yml | 2 +- .github/workflows/prepare_for_release.yml | 17 ++----------- .github/workflows/source_clear_cron.yml | 2 +- .github/workflows/swift.yml | 31 ++++++++--------------- .github/workflows/unit_tests.yml | 11 +------- 6 files changed, 17 insertions(+), 57 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 862c4303..3ac839bb 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -7,10 +7,6 @@ on: required: true TRAVIS_COM_TOKEN: required: true - PREP: - required: false - RELEASE: - required: false jobs: integration_tests: @@ -41,7 +37,6 @@ jobs: TESTAPP_BRANCH: master GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_EVENT_TYPE: ${{ github.event_name }} - GITHUB_CONTEXT: ${{ toJson(github) }} TRAVIS_REPO_SLUG: ${{ github.repository }} TRAVIS_PULL_REQUEST_SLUG: ${{ github.repository }} UPSTREAM_REPO: ${{ github.repository }} @@ -52,9 +47,5 @@ jobs: TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} EVENT_MESSAGE: ${{ github.event.message }} HOME: 'home/runner' - PREP: ${{ secrets.PREP }} - RELEASE: ${{ secrets.RELEASE }} - if: "${{ env.PREP == '' && env.RELEASE == '' }}" run: | - echo "$GITHUB_CONTEXT" - home/runner/travisci-tools/trigger-script-with-status-update.sh \ No newline at end of file + home/runner/travisci-tools/trigger-script-with-status-update.sh diff --git a/.github/workflows/lint_markdown.yml b/.github/workflows/lint_markdown.yml index cf002b7f..e3e90314 100644 --- a/.github/workflows/lint_markdown.yml +++ b/.github/workflows/lint_markdown.yml @@ -6,7 +6,7 @@ jobs: lint_markdown: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/prepare_for_release.yml b/.github/workflows/prepare_for_release.yml index a31803ba..418a5a35 100644 --- a/.github/workflows/prepare_for_release.yml +++ b/.github/workflows/prepare_for_release.yml @@ -5,23 +5,11 @@ on: secrets: CI_USER_TOKEN: required: true - PREP: - required: false jobs: prepare_for_release: runs-on: macos-latest steps: - - name: set SDK Branch if PR - if: ${{ github.event_name == 'pull_request' }} - run: | - echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV - echo "TRAVIS_BRANCH=${{ github.base_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 - uses: maxim-lobanov/setup-xcode@v1 - uses: actions/checkout@v3 with: @@ -32,13 +20,12 @@ jobs: VERSION: 3.10.1 HOME: 'home/runner' TRAVIS_REPO_SLUG: ${{ github.repository }} + TRAVIS_BRANCH: ${{ github.ref_name }} GITHUB_USER: optibot GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} - PREP: ${{ secrets.PREP }} - if: "${{ env.PREP == 'true' }}" run: | gem install cocoapods -v '1.9.3' Scripts/run_prep.sh - name: Check prepare for release failure if: steps.prepare_for_release.conclusion == 'failure' - run: cat /tmp/build.out \ No newline at end of file + run: cat /tmp/build.out diff --git a/.github/workflows/source_clear_cron.yml b/.github/workflows/source_clear_cron.yml index 884cd2f0..4a9b2dcf 100644 --- a/.github/workflows/source_clear_cron.yml +++ b/.github/workflows/source_clear_cron.yml @@ -11,7 +11,7 @@ jobs: source_clear: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Source clear scan env: SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }} diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index d45e207e..e7628d37 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -7,10 +7,14 @@ on: branches: [ master ] workflow_dispatch: inputs: - SNAPSHOT: + PREP: required: false type: boolean - description: Set SNAPSHOT true to publish + description: prepare to release + RELEASE: + required: false + type: boolean + description: release jobs: @@ -18,13 +22,11 @@ jobs: uses: optimizely/swift-sdk/.github/workflows/lint_markdown.yml@yasir/gitAction integration_tests: - if: ${{ github.event.inputs.SNAPSHOT != 'true' }} + if: "${{ github.event.inputs.PREP == '' && github.event.inputs.RELEASE == '' }}" uses: optimizely/swift-sdk/.github/workflows/integration_tests.yml@yasir/gitAction secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }} - PREP: ${{ secrets.PREP }} - RELEASE: ${{ secrets.RELEASE }} lint: runs-on: macos-latest @@ -41,31 +43,21 @@ jobs: 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@yasir/gitAction secrets: COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} - PREP: ${{ secrets.PREP }} - RELEASE: ${{ secrets.RELEASE }} prepare_for_release: - if: "${{ github.event.inputs.SNAPSHOT == 'true' && github.event_name == 'workflow_dispatch' }}" + if: "${{ github.event.inputs.PREP == 'true' && github.event_name == 'workflow_dispatch' }}" uses: optimizely/swift-sdk/.github/workflows/prepare_for_release.yml@yasir/gitAction secrets: CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }} - PREP: ${{ secrets.PREP }} release: - if: "${{github.event.inputs.SNAPSHOT == 'true' && github.event_name == 'workflow_dispatch' }}" + if: "${{github.event.inputs.RELEASE == 'true' && github.event_name == 'workflow_dispatch' }}" runs-on: macos-latest steps: - - name: set SDK Branch if PR - if: ${{ github.event_name == 'pull_request' }} - run: | - echo "TRAVIS_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV - - name: set SDK Branch if not pull request - if: ${{ github.event_name != 'pull_request' }} - run: | - echo "TRAVIS_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV - uses: actions/checkout@v3 - uses: maxim-lobanov/setup-xcode@v1 with: @@ -74,8 +66,7 @@ jobs: env: VERSION: 3.10.1 GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }} - RELEASE: ${{ secrets.RELEASE }} - if: "${{ env.RELEASE == 'true' }}" + TRAVIS_BRANCH: ${{ github.ref_name }} run: | gem install cocoapods -v '1.9.3' Scripts/run_release.sh diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index c75c26ec..629501bd 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -5,10 +5,6 @@ on: secrets: COVERALLS_TOKEN: required: true - PREP: - required: false - RELEASE: - required: false jobs: unittests: @@ -53,17 +49,13 @@ jobs: - name: set SDK Branch if PR if: ${{ github.event_name == 'pull_request' }} run: | - echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV echo "TRAVIS_BRANCH=${{ github.base_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 - id: unit_tests env: - PREP: ${{ secrets.PREP }} - RELEASE: ${{ secrets.RELEASE }} COVERAGE_DIR: ./COVERAGE SCHEME: ${{ matrix.scheme }} TEST_SDK: ${{ matrix.test_sdk }} @@ -73,7 +65,6 @@ jobs: SIMULATOR_XCODE_VERSION: ${{ matrix.simulator_xcode_version }} NAME: ${{ matrix.device }} COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} - if: "${{ env.PREP == '' && env.RELEASE == '' }}" run: | gem install coveralls-lcov gem install cocoapods -v '1.9.3' @@ -92,4 +83,4 @@ jobs: if: steps.unit_tests.outcome == 'success' run: | Scripts/upload_coveralls.sh - sleep 5 \ No newline at end of file + sleep 5