Skip to content

Commit

Permalink
Fix syntax error in job pre-condition (#126)
Browse files Browse the repository at this point in the history
build(workflow): fix syntax error in job pre-condition

build(workflow): improve tests and validation workflows
  • Loading branch information
parfeon authored Jan 3, 2023
1 parent 98db04d commit e05ba29
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/commands-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ defaults:
jobs:
process:
name: Process command
if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true
if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true
runs-on: ubuntu-latest
steps:
- name: Check referred user
id: user-check
shell: bash
env:
CLEN_BOT: ${{ secrets.CLEN_BOT }}
run: echo "expected-user=${{ startsWith(github.event.comment.body, format('@{0} ', env.CLEN_BOT)) }}" >> $GITHUB_OUTPUT
Expand All @@ -41,4 +40,4 @@ jobs:
with:
token: ${{ secrets.GH_TOKEN }}
listener: ${{ secrets.CLEN_BOT }}
jira-api-key: ${{ secrets.JIRA_API_KEY }}
jira-api-key: ${{ secrets.JIRA_API_KEY }}
11 changes: 8 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
check-release:
name: Check release required
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged && endsWith(github.repository, '-private') != true }}
if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true
outputs:
release: ${{ steps.check.outputs.ready }}
steps:
Expand All @@ -28,9 +28,9 @@ jobs:
token: ${{ secrets.GH_TOKEN }}
publish:
name: Publish package
runs-on: macos-11
runs-on: macos-12
needs: check-release
if: ${{ needs.check-release.outputs.release == 'true' }}
if: needs.check-release.outputs.release == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -56,3 +56,8 @@ jobs:
token: ${{ secrets.GH_TOKEN }}
jira-api-key: ${{ secrets.JIRA_API_KEY }}
last-service: true
- name: Upload test reports
uses: ./.github/.release/actions/actions/test-reports/upload
with:
token: ${{ secrets.GH_TOKEN }}
acceptance-tests-workflow: Tests
10 changes: 10 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
run: xcrun simctl list -j
- name: Run ${{ matrix.environment }} unit tests
run: bundle exec fastlane test --env $(echo ${{ matrix.environment }} | tr '[:upper:]' '[:lower:]')
- name: Cancel workflow runs for commit on error
if: failure()
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
acceptance-tests:
name: Acceptance tests
runs-on: macos-12
Expand Down Expand Up @@ -105,3 +108,10 @@ jobs:
name: acceptance-test-reports
path: Results/*.json
retention-days: 7
all-tests:
name: Tests
runs-on: ubuntu-latest
needs: [tests, acceptance-tests]
steps:
- name: Tests summary
run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed"
32 changes: 31 additions & 1 deletion .github/workflows/run-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults:
shell: bash

jobs:
repository-validators:
pubnub-yml:
name: "Validate .pubnub.yml"
runs-on: ubuntu-latest
steps:
Expand All @@ -28,6 +28,9 @@ jobs:
uses: ./.github/.release/actions/actions/validators/pubnub-yml
with:
token: ${{ secrets.GH_TOKEN }}
- name: Cancel workflow runs for commit on error
if: failure()
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
package-managers-validation:
name: Validate package managers
runs-on: macos-12
Expand All @@ -39,6 +42,13 @@ jobs:
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: Checkout actions
uses: actions/checkout@v3
with:
repository: pubnub/client-engineering-deployment-tools
ref: v1
token: ${{ secrets.GH_TOKEN }}
path: .github/.release/actions
- name: Setup Ruby 2.6.6
uses: ruby/setup-ruby@v1
with:
Expand All @@ -55,6 +65,9 @@ jobs:
${{ runner.os }}-spm-
- name: ${{ matrix.managers }} validation
run: bundle exec fastlane lint_$(echo ${{ matrix.managers }} | tr '[:upper:]' '[:lower:]' | tr ' ' '_')
- name: Cancel workflow runs for commit on error
if: failure()
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
demo-app-validation:
name: Validate demo application
runs-on: macos-12
Expand All @@ -63,6 +76,13 @@ jobs:
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: Checkout actions
uses: actions/checkout@v3
with:
repository: pubnub/client-engineering-deployment-tools
ref: v1
token: ${{ secrets.GH_TOKEN }}
path: .github/.release/actions
- name: Setup Ruby 2.6.6
uses: ruby/setup-ruby@v1
with:
Expand All @@ -79,3 +99,13 @@ jobs:
${{ runner.os }}-spm-
- name: Demo application build validation
run: bundle exec fastlane build_example --env ios
- name: Cancel workflow runs for commit on error
if: failure()
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
all-validations:
name: Validations
runs-on: ubuntu-latest
needs: [pubnub-yml, package-managers-validation, demo-app-validation]
steps:
- name: Validations summary
run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed"

0 comments on commit e05ba29

Please sign in to comment.