Skip to content

Commit

Permalink
Merge branch 'master' into IOPID-2566-auth-error-screen
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMattew authored Dec 18, 2024
2 parents 9d346fa + 7d9df54 commit 0e30587
Show file tree
Hide file tree
Showing 198 changed files with 31,144 additions and 19,498 deletions.
37 changes: 24 additions & 13 deletions .github/actions/setup-composite/action.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
name: Actions to setup environment for all workflows
description: 'This action collects the steps to setup any job'
description: "This action collects the steps to setup any job"
runs:
using: "composite"
steps:
- id: enable-corepack
shell: bash
run: corepack enable
- id: setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: '.node-version'
- id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
shell: bash
node-version-file: ".node-version"
- id: yarn-cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
- id: install-packages
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile
shell: bash
- id: generate-api-client
run: yarn generate
shell: bash
shell: bash
- id: upload-locales-artifact
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
with:
name: locales
path: locales/
- id: upload-clients-artifact
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
with:
name: api-client
path: definitions/
39 changes: 0 additions & 39 deletions .github/workflows/danger.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/distribute-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- id: setup
uses: ./.github/actions/setup-composite
- id: setup-ruby
uses: ruby/setup-ruby@d2b39ad0b52eca07d23f3aa14fdf2a3fcc1f411c #v1.149.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: build-release-android
Expand All @@ -35,7 +35,7 @@ jobs:
- id: setup
uses: ./.github/actions/setup-composite
- id: setup-ruby
uses: ruby/setup-ruby@5f19ec79cedfadb78ab837f95b87734d0003c899 #v1.173.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: prepare-ios-build
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/pr-title-linter-and-linker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: "Lint and Link PR title"

on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize

jobs:
lint:
name: Validate PR title And link Jira Issue
runs-on: ubuntu-22.04
env:
JIRA_COMMENT_REGEX: "^.*Jira.*"
steps:
- uses: Slashgear/action-check-pr-title@860e8dc639f8e60335a6f5e8936ba67ed2536890 #v4.3.0
id: lint
with:
regexp: "\\[(#?[A-Z]*-[0-9]*,?){1,}\\]" # Regex the title should match.
continue-on-error: true

- name: Find Jira Comment
uses: peter-evans/find-comment@81e2da3af01c92f83cb927cf3ace0e085617c556 #v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-regex: "${{ env.JIRA_COMMENT_REGEX }}"

- name: Extract Jira Issue to Link
id: extract_jira_issue
if: steps.lint.outcome == 'success'
run: |
PR_TITLE=$(echo "${{ github.event.pull_request.title }}")
ISSUES_STR=$(awk -F'\\[|\\]' '{print $2}' <<< "$PR_TITLE" | sed "s/#//g")
IFS=',' read -ra ISSUES <<< "$ISSUES_STR"
JIRA_ISSUE=$(echo "${ISSUES[-1]}" | sed 's/^ *//;s/ *$//')
MARKDOWN_CARRIAGE_RETURN="<br>"
MARKDOWN_PREFIX="- Link to"
JIRA_COMMENT_MARKDOWN="This Pull Request refers to Jira issues:<br>"
if [[ ${#ISSUES[@]} -eq 1 ]]; then
JIRA_COMMENT_MARKDOWN="This Pull Request refers to the following Jira issue"
MARKDOWN_PREFIX=""
fi
for ISSUE in "${ISSUES[@]}"; do
ISSUE=$(echo "$ISSUE" | sed 's/^ *//;s/ *$//') # Trim spaces
JIRA_COMMENT_MARKDOWN+="$MARKDOWN_PREFIX [$ISSUE](https://pagopa.atlassian.net/browse/$ISSUE) $MARKDOWN_CARRIAGE_RETURN"
done
echo "JIRA_ISSUE=$JIRA_ISSUE" >> $GITHUB_ENV
echo "JIRA_COMMENT_MARKDOWN=$JIRA_COMMENT_MARKDOWN" >> $GITHUB_ENV
- name: Create Jira Link comment
if: steps.lint.outcome == 'success'
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 #v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## Jira Pull Request Link ##
${{ env.JIRA_COMMENT_MARKDOWN }}
edit-mode: replace
- name: Create Empty Jira Link comment
if: steps.lint.outcome != 'success'
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 #v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## Jira Pull request Link ##
It seems this Pull Request has no issues that refers to Jira!!!
Please check it out.
edit-mode: replace
- name: Failure message
if: steps.lint.outcome != 'success'
run: |
echo "Pull request title (${{ github.event.pull_request.title }}) is not properly formatted or it is not related to any Jira issue"
exit 1
4 changes: 2 additions & 2 deletions .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- id: setup-android-sdk
uses: android-actions/setup-android@00854ea68c109d98c75d956347303bf7c45b0277 #v3.2.1
- id: setup-ruby
uses: ruby/setup-ruby@d2b39ad0b52eca07d23f3aa14fdf2a3fcc1f411c #v1.149.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: build-release-android
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
- id: setup
uses: ./.github/actions/setup-composite
- id: setup-ruby
uses: ruby/setup-ruby@5f19ec79cedfadb78ab837f95b87734d0003c899 #v1.173.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: prepare-ios-build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-new-cycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- id: setup-android-sdk
uses: android-actions/setup-android@00854ea68c109d98c75d956347303bf7c45b0277 #v3.2.1
- id: setup-ruby
uses: ruby/setup-ruby@d2b39ad0b52eca07d23f3aa14fdf2a3fcc1f411c #v1.149.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: build-release-android
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
- id: setup
uses: ./.github/actions/setup-composite
- id: setup-ruby
uses: ruby/setup-ruby@5f19ec79cedfadb78ab837f95b87734d0003c899 #v1.173.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: prepare-ios-build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- id: setup-android-sdk
uses: android-actions/setup-android@00854ea68c109d98c75d956347303bf7c45b0277 #v3.2.1
- id: setup-ruby
uses: ruby/setup-ruby@d2b39ad0b52eca07d23f3aa14fdf2a3fcc1f411c #v1.149.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: build-release-android
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
- id: setup
uses: ./.github/actions/setup-composite
- id: setup-ruby
uses: ruby/setup-ruby@5f19ec79cedfadb78ab837f95b87734d0003c899 #v1.173.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: prepare-ios-build
Expand Down
41 changes: 37 additions & 4 deletions .github/workflows/staticcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ on:
- pull_request
- workflow_call
jobs:
checks:
static-checks:
runs-on: ubuntu-latest
environment: dev
concurrency:
group: ${{ github.workflow }}-pr-staticcheck-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand All @@ -19,9 +18,43 @@ jobs:
run: yarn lint
- id: run-prettier
run: yarn prettier:check
unit-test:
runs-on: ubuntu-latest
environment: dev
needs: static-checks
strategy:
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
steps:
- id: checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- id: setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: ".node-version"
- id: yarn-cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
- id: install-packages
run: yarn install --frozen-lockfile
- id: download-locales
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: locales
path: locales/
- id: download-api-client
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: api-client
path: definitions/
- id: run-test
run: yarn test:ci
run: yarn test:ci --shard=${{ matrix.shard }}/${{ strategy.job-total }}
- id: codecov-script
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
use-cache: 'true'
- id: setup-ruby
uses: ruby/setup-ruby@5f19ec79cedfadb78ab837f95b87734d0003c899 #v1.173.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: prepare-dependencies
Expand Down
13 changes: 9 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
**/.xcode.env.local

# Ruby / CocoaPods
/ios/Pods/
**/Pods/
/vendor/bundle/

# Android/IntelliJ
Expand Down Expand Up @@ -112,5 +112,10 @@ sentry.properties
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# yarn cache dir
.yarn/cache
# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
Loading

0 comments on commit 0e30587

Please sign in to comment.