Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Enable linting Pods and re-organize setup.mjs file #10880

Merged
merged 73 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
159dede
Move Gemfile into ios dir
Cal-L Aug 29, 2024
20163d5
Update commands that run bundle install or exec
Cal-L Aug 29, 2024
256b8d5
Run pod install in CI to detect Podfile diffs
Cal-L Aug 29, 2024
c930d80
Run pod install to detect pod diffs
Cal-L Aug 29, 2024
8971f70
Don't skip pod install for diff
Cal-L Aug 29, 2024
8e259b6
Remove jetifier since it happens automatically
Cal-L Aug 29, 2024
de48743
Refactor setup file
Cal-L Aug 29, 2024
8bd7f50
Fix missing task
Cal-L Aug 29, 2024
2c9ffa3
Add setup conditions for node and diff
Cal-L Aug 29, 2024
5511d77
Fix ios step
Cal-L Aug 29, 2024
9a98379
Don't ski ios
Cal-L Aug 29, 2024
e57ec1c
Use script for ios steps
Cal-L Aug 29, 2024
6482a3b
Install bundler
Cal-L Aug 29, 2024
fb810ef
Install rbenv
Cal-L Aug 29, 2024
a889cdb
Use ruby action
Cal-L Aug 29, 2024
567a35d
Run bundle install
Cal-L Aug 29, 2024
2fd8385
Merge branch 'main' into chore/detect-pod-diffs
legobeat Aug 30, 2024
250c88c
chore(ci): pin action ruby/setup-ruby
legobeat Aug 30, 2024
327c39c
chore: update Gemfile path in Dockerfile
legobeat Aug 30, 2024
14921ab
Add LANG env var to docker
Cal-L Sep 4, 2024
c43066f
Merge branch 'main' of github.com:MetaMask/metamask-mobile into chore…
Cal-L Sep 4, 2024
a869d8b
Remove duplicate openssl
Cal-L Sep 4, 2024
0d96086
Specify GemFile
Cal-L Sep 4, 2024
d0c577b
Move BUNDLE_GEMFILE for ruby
Cal-L Sep 5, 2024
b812b71
Try just yarn setup
Cal-L Sep 5, 2024
5b49f99
Remove IS_CI
Cal-L Sep 5, 2024
2c90132
Force build ios
Cal-L Sep 5, 2024
20c97d7
Build for ios
Cal-L Sep 5, 2024
3d17fde
Build ios
Cal-L Sep 5, 2024
7b9992b
Run diff step on macos
Cal-L Sep 5, 2024
9ab7297
Remove setup step
Cal-L Sep 5, 2024
f68371c
Remove setup
Cal-L Sep 5, 2024
e4f648c
Disable ios
Cal-L Sep 5, 2024
d990bfe
Ignore deps for depscheck
Cal-L Sep 5, 2024
bf48abd
Re-add setup
Cal-L Sep 5, 2024
858ad54
Remove setup
Cal-L Sep 5, 2024
91cd35c
Merge branch 'main' of github.com:MetaMask/metamask-mobile into chore…
Cal-L Sep 5, 2024
91b2f71
Add back setup step
Cal-L Sep 6, 2024
1ed3686
Keep testing
Cal-L Sep 6, 2024
70ba20f
lint tsc step
Cal-L Sep 6, 2024
c1f3e76
Clean up setup.mjs
Cal-L Sep 6, 2024
435e6b7
Clean up docker
Cal-L Sep 6, 2024
1d64482
Try to remove --node from docker run
Cal-L Sep 6, 2024
b796c15
Change setup to check-diff step
Cal-L Sep 6, 2024
fda063d
Use correct ruby
Cal-L Sep 6, 2024
2113bf2
Use setup --node in ci
Cal-L Sep 6, 2024
d4d064f
Remove --node in steps
Cal-L Sep 6, 2024
1486f76
Ignore detached head
Cal-L Sep 6, 2024
afd53cf
merge from main
Cal-L Sep 6, 2024
12ce53a
Dont run pod install for docker
Cal-L Sep 7, 2024
b112054
Remove node arg from docker and commit pod diff
Cal-L Sep 7, 2024
7c660d9
Change arg to skip pods
Cal-L Sep 7, 2024
99f1994
Merge branch 'main' of github.com:MetaMask/metamask-mobile into chore…
Cal-L Sep 7, 2024
9172d5f
Enable pods for docker
Cal-L Sep 16, 2024
d5f809f
Merge from mian
Cal-L Sep 16, 2024
54539f5
Revert pod command
Cal-L Sep 18, 2024
9e77412
Update bundle install commands
Cal-L Sep 18, 2024
dec4344
Update pod file
Cal-L Sep 18, 2024
f87c96d
Merge branch 'main' into chore/detect-pod-diffs
Cal-L Sep 18, 2024
a736f4d
Add back jetify
Cal-L Sep 18, 2024
b76866e
Merge branch 'chore/detect-pod-diffs' of github.com:MetaMask/metamask…
Cal-L Sep 18, 2024
a0918b1
Merge branch 'main' into chore/detect-pod-diffs
Cal-L Sep 18, 2024
d2d77cf
Consolidate build ios
Cal-L Sep 20, 2024
3899a42
Merge branch 'main' into chore/detect-pod-diffs
Cal-L Sep 20, 2024
6132ada
Merge branch 'main' of github.com:MetaMask/metamask-mobile into chore…
Cal-L Sep 20, 2024
e7a9437
Merge branch 'chore/detect-pod-diffs' of github.com:MetaMask/metamask…
Cal-L Sep 20, 2024
36f57ae
Fix xproj diff
Cal-L Sep 20, 2024
c5b1391
Change to macos-latest
Cal-L Sep 20, 2024
fc6238f
Merge branch 'main' into chore/detect-pod-diffs
Cal-L Sep 20, 2024
9a18b28
Merge branch 'main' into chore/detect-pod-diffs
Cal-L Sep 23, 2024
eced61a
Merge branch 'main' into chore/detect-pod-diffs
legobeat Sep 23, 2024
990ef19
Update scripts/setup.mjs
Cal-L Sep 24, 2024
a3463d9
Merge branch 'main' into chore/detect-pod-diffs
Cal-L Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ignores:
- 'webpack-cli'
- '@react-native-community/datetimepicker'
- '@react-native-community/slider'
- 'patch-package'
Cal-L marked this conversation as resolved.
Show resolved Hide resolved
- '@lavamoat/allow-scripts'
# This is used on the patch for TokenRatesController of Assets controllers, for we to be able to use the last version of it
- cockatiel

Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ on:
pull_request:
merge_group:
types: [checks_requested]

jobs:
setup:
runs-on: ubuntu-20.04
check-diff:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 #v1
Cal-L marked this conversation as resolved.
Show resolved Hide resolved
with:
ruby-version: '3.1.5'
bundler-cache: true
env:
BUNDLE_GEMFILE: ios/Gemfile
- name: Determine whether the current PR is a draft
id: set-is-draft
if: github.event_name == 'pull_request' && github.event.pull_request.number
Expand All @@ -27,7 +33,7 @@ jobs:
run: printf '%s\n\n%s' '@metamask:registry=https://npm.pkg.github.com' "//npm.pkg.github.com/:_authToken=${PACKAGE_READ_TOKEN}" > .npmrc
env:
PACKAGE_READ_TOKEN: ${{ secrets.PACKAGE_READ_TOKEN }}
- run: yarn setup --node
- run: yarn setup
- name: Require clean working directory
shell: bash
run: |
Expand All @@ -39,7 +45,6 @@ jobs:
fi
dedupe:
runs-on: ubuntu-20.04
needs: setup
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -58,7 +63,6 @@ jobs:
fi
scripts:
runs-on: ubuntu-20.04
needs: setup
strategy:
matrix:
scripts:
Expand Down Expand Up @@ -86,7 +90,6 @@ jobs:
fi
unit-tests:
runs-on: ubuntu-20.04
needs: setup
strategy:
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Expand Down Expand Up @@ -156,7 +159,6 @@ jobs:

js-bundle-size-check:
runs-on: ubuntu-20.04
needs: setup
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -270,7 +272,7 @@ jobs:
runs-on: ubuntu-20.04
needs:
[
setup,
check-diff,
Cal-L marked this conversation as resolved.
Show resolved Hide resolved
dedupe,
scripts,
unit-tests,
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ on:
branches: main
pull_request:


jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3

- uses: actions/checkout@v3

- name: Build and load
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
with:
context: .
file: scripts/docker/Dockerfile
Expand Down
10 changes: 0 additions & 10 deletions Gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ workflows:
- content: |-
#!/usr/bin/env bash
echo "Gems being installed with bundler gem"
bundle install
bundle install --gemfile=ios/Gemfile
echo "Node $NODE_VERSION being installed"

set -e
Expand Down
2 changes: 1 addition & 1 deletion docs/readme/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Install ruby version defined in the file `.ruby-version`
Install [`bundler`](https://bundler.io/) gem to manage and install gems such as Cocoapods. The `bundle install` command, which is run during `yarn setup` handles installing gem versions as specified in the project's `GemFile`

```bash
gem install bundler -v 2.5.8 && bundle install
gem install bundler -v 2.5.8 && bundle install --gemfile=ios/Gemfile
```

### Xcode
Expand Down
11 changes: 7 additions & 4 deletions ios/Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# frozen_string_literal: true
source 'https://rubygems.org'

source "https://rubygems.org"
# Recommended to use http://rbenv.org/ to install and use this version
ruby '>= 3.1.5'

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
# Allow minor version updates up to but excluding 2.0.0
gem 'cocoapods', '~> 1.12'

# gem "rails"
# Allow all version updates up to but excluding 7.1.0
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
File renamed without changes.
12 changes: 2 additions & 10 deletions ios/MetaMask.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1555,11 +1555,7 @@
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
Expand Down Expand Up @@ -1603,11 +1599,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
"-Wl",
"-ld_classic",
);
OTHER_LDFLAGS = "$(inherited)";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand Down
5 changes: 0 additions & 5 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ def common_target_logic
# use_frameworks!
pod 'Permission-BluetoothPeripheral', :path => '../node_modules/react-native-permissions/ios/BluetoothPeripheral'
pod 'GzipSwift'

# Adding OpenSSL-Universal to fix build issues in react-native-quick-crypto
# Ref: https://github.com/margelo/react-native-quick-crypto/issues/121
# Ref: https://stackoverflow.com/questions/29082174/ios-xcode-build-failing-due-to-openssl/76455587#76455587
pod 'OpenSSL-Universal', :modular_headers => true, :configurations => ['Release']
Cal-L marked this conversation as resolved.
Show resolved Hide resolved
end

target 'MetaMask' do
Expand Down
3 changes: 1 addition & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,6 @@ DEPENDENCIES:
- GzipSwift
- lottie-ios (from `../node_modules/lottie-ios`)
- lottie-react-native (from `../node_modules/lottie-react-native`)
- OpenSSL-Universal
- OpenSSL-Universal (= 1.1.1100)
- Permission-BluetoothPeripheral (from `../node_modules/react-native-permissions/ios/BluetoothPeripheral`)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
Expand Down Expand Up @@ -1303,6 +1302,6 @@ SPEC CHECKSUMS:
Yoga: 6f5ab94cd8b1ecd04b6e973d0bc583ede2a598cc
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 3514934ac1830af4ca844ba018f38720a48d006b
PODFILE CHECKSUM: 0e9407472193b5f7d5cfe4715c8f1f2c2fed42e5

COCOAPODS: 1.15.2
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"watch:clean": "./scripts/build.sh watcher clean",
"clean:ios": "rm -rf ios/build",
"pod:install": "command -v pod && bundle exec pod install --project-directory=ios || echo \"pod command not found. Skipping pod install\"",
"gem:bundle:install": "bundle install --gemfile=ios/Gemfile",
"clean:ppom": "rm -rf ppom/dist ppom/node_modules app/lib/ppom/ppom.html.js",
"clean:android": "rm -rf android/app/build",
"clean:node": "rm -rf node_modules && yarn --frozen-lockfile",
Expand All @@ -18,7 +19,6 @@
"lint:tsc": "tsc --project ./tsconfig.json",
"format": "prettier '**/*.{js,ts,tsx,json,feature}' --write",
"setup": "yarn clean && node scripts/setup.mjs",
"setup:node": "yarn allow-scripts && yarn patch-package",
Cal-L marked this conversation as resolved.
Show resolved Hide resolved
"setup:e2e": "cd wdio && yarn install",
"setup:detox-e2e": "./scripts/detox-setup.sh",
"start:ios": "./scripts/build.sh ios debug",
Expand Down
9 changes: 6 additions & 3 deletions scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN bash -c "[ ${GID} != \"1000\" ] && groupadd -g ${GID} -U node userz || true
&& echo '%sudo ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

# install ruby deps
COPY --chown=${UID}:${GID} Gemfile* .ruby-version /tmp/app/
COPY --chown=${UID}:${GID} ios/Gemfile* .ruby-version /tmp/app/
WORKDIR /tmp/app

####
Expand All @@ -58,7 +58,10 @@ RUN bash -c 'eval "$(/home/node/.rbenv/bin/rbenv init -)" \
&& bundle install'

# fix broken ipv6 on nodejs v20
env NODE_OPTIONS="--no-network-family-autoselection --trace-warnings"
env PATH=/home/node/.rbenv/shims/:$PATH
ENV NODE_OPTIONS="--no-network-family-autoselection --trace-warnings"
# minimize ruby memory usage
ENV MALLOC_ARENA_MAX=1
ENV PATH=/home/node/.rbenv/shims/:$PATH
ENV LANG=en_US.UTF-8

WORKDIR /app
Loading
Loading