Skip to content

Commit

Permalink
Merge pull request #1308 from dedis/work-fe1-nico-drawer-navigation-u…
Browse files Browse the repository at this point in the history
…pdate-dependencies

Update dependencies
  • Loading branch information
pierluca authored Feb 16, 2023
2 parents f69c71a + 7ab0b83 commit 1eb58ae
Show file tree
Hide file tree
Showing 74 changed files with 37,913 additions and 52,251 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
node-version: [16.x]
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [18.x]
include:
# Additionally also run it on node v16
# but just on ubuntu to not have too many runs
- os: ubuntu-latest
node-version: 16.x

defaults:
run:
Expand All @@ -35,11 +40,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Setup expo action
uses: expo/expo-github-action@v5
with:
expo-version: 6.x

- name: Setup node cache
uses: actions/cache@v2
env:
Expand All @@ -53,16 +53,18 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup expo
run: npm install -g @expo/cli

- name: Setup npm dependencies
run: |
npm install
run: npm install

- name: Check npm security issues
run: npm audit fix
continue-on-error: true

- name: Run lint
if: ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == '16.x' }} # execute even if previous steps failed
if: ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == '18.x' }} # execute even if previous steps failed
run: npm run eslint

- name: Validate dependencies
Expand All @@ -75,10 +77,10 @@ jobs:

- name: Run test
if: ${{ always() }} # execute even if previous steps failed
run: npm run test
run: npm run test -- --runInBand --ci

- name: Run code analysis
if: ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == '16.x' }} # execute even if previous steps failed
if: ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == '18.x' }} # execute even if previous steps failed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
run: |
Expand All @@ -92,9 +94,15 @@ jobs:
continue-on-error: true

- name: Build expo web project
if: ${{ matrix.node-version != '16.x' }}
run: |
npm run build-web
- name: Build expo web project (legacy, without NODE_OPTIONS=--openssl-legacy-provider)
if: ${{ matrix.node-version == '16.x' }}
run: |
npx expo export:web
be1-go:
name: Be1-Go
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18

# Save some build information to inject into the APP
- name: Get the version
Expand Down
4 changes: 2 additions & 2 deletions fe1-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ npm start

> If the Exception *Tried to register two views with the same name NRCSafeAreaProvider*, [follow these steps](https://github.com/th3rdwave/react-native-safe-area-context/issues/110#issuecomment-660407790) :
>
> - delete `node_modules` folder
> - delete `node_modules` folder
> - run `npm install`
> - delete `node_modules/expo/node_modules/react-native-safe-area-context` folder
> - delete `node_modules/expo/node_modules/react-native-safe-area-context` folder
> - run `expo r -c`
>
> The following times, running the command `expo start` is enough
Expand Down
2 changes: 2 additions & 0 deletions fe1-web/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ module.exports = (api) => {
}
},
],
'@babel/plugin-proposal-export-namespace-from',
// Reanimated plugin has to be listed last (https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/)
'react-native-reanimated/plugin'
],
};
Expand Down
22 changes: 17 additions & 5 deletions fe1-web/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,23 @@ If you write E2E tests, please be mindful of making them maintainable through th

## Deployments

Please reach out to the DEDIS Engineering team members to deploy a build to an
internet accessible host.

The web application can be packaged for deploynent by executing `npm run build-web`.
This will generate a timestamped zip package in the `./dist` folder.
The application can be automatically deployed to `fe1.personhood.online` by
creating a [release](https://github.com/dedis/popstellar/releases) on GitHub
starting with the prefix `fe1-`.

The web application can also be locally packaged for deployment by executing
`npm run build-web`.

### `--openssl-legacy-provider` is not allowed in NODE_OPTIONS

In case you experience the error `--openssl-legacy-provider is not
allowed in NODE_OPTIONS` then it is due to the workaround introduced here:
https://github.com/dedis/popstellar/pull/1308#issuecomment-1426683039. The
problem is that expo with node version > 16 only works with the
`--openssl-legacy-provider` flag but this flag makes builds fail on v16. You can
still create a build using node v16 by manually running `npx expo export:web`
rather than `npm run build-web`. This will generate a timestamped zip package in
the `./dist` folder.


## Coding Style
Expand Down
1 change: 1 addition & 0 deletions fe1-web/jest/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
// Icons and snapshot tests do not work nice together
// See https://github.com/expo/expo/issues/3566
jest.mock('@expo/vector-icons');
jest.mock('@rneui/base/dist/Icon');
jest.mock('react-blockies', () => 'blockies');

// qr codes are svgs and thus generate huge snapshot files
Expand Down
21 changes: 2 additions & 19 deletions fe1-web/jest/setupFakeTimers.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
import FakeTimers from '@sinonjs/fake-timers';

/**
* Sets up fake timers for tests.
*
* @remarks
* We use a library because there is an issue between jest.useFakeTimers and asynchronous tests.
* (see https://github.com/facebook/jest/issues/10221)
*/
import { jest } from '@jest/globals';

const FIXED_SYSTEM_TIME = new Date(1620255600 * 1000); // 5 May 2021

let clock;
global.beforeAll(() => {
clock = FakeTimers.install({
now: FIXED_SYSTEM_TIME,
shouldAdvanceTime: true,
toFake: ['Date'],
});
});

global.afterAll(() => {
clock.uninstall();
jest.useFakeTimers({ advanceTimers: true, now: FIXED_SYSTEM_TIME });
});
Loading

0 comments on commit 1eb58ae

Please sign in to comment.