Skip to content

Commit

Permalink
chore(build): migrate to nx@17 and remove lerna (#2317)
Browse files Browse the repository at this point in the history
* migrate to nx@17 and remove lerna

* update actions

* fix

* clean up

* clean up
  • Loading branch information
jonathanfallon authored Nov 9, 2023
1 parent 89a334b commit e765992
Show file tree
Hide file tree
Showing 12 changed files with 3,703 additions and 9,320 deletions.
41 changes: 25 additions & 16 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20'

Expand All @@ -41,10 +41,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20'

Expand All @@ -66,10 +66,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Nx Cache
id: nx-cache
uses: actions/cache@v3
with:
path: api/.nx/cache
key: ${{ runner.os }}-nx-cache
restore-keys: ${{ runner.os }}-nx-cache

- name: Install NodeJS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
Expand All @@ -81,14 +89,10 @@ jobs:

- name: Build
run: npm run build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
working-directory: api

- name: Run Unit test
run: npm run test:unit
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
working-directory: api

codeql:
Expand All @@ -102,7 +106,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

Expand All @@ -123,10 +127,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Nx Cache
id: nx-cache
uses: actions/cache@v3
with:
path: api/.nx/cache
key: ${{ runner.os }}-nx-cache
restore-keys: ${{ runner.os }}-nx-cache

- name: Install NodeJS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
Expand All @@ -138,8 +150,6 @@ jobs:

- name: Build
run: npm run build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
working-directory: api

- name: Add host entries
Expand Down Expand Up @@ -174,5 +184,4 @@ jobs:
APP_SESSION_SECRET: null
APP_ROUTECACHE_AUTHTOKEN: null
AWS_REGION: fr-par
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
run: ./integration.sh run
4 changes: 2 additions & 2 deletions .github/workflows/base-deploy-to-bucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install NodeJS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/deploy-backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ jobs:
- { name: 'datatools', dockerfile: './docker/notebook/Dockerfile' }
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Nx Cache
id: nx-cache
uses: actions/cache@v3
with:
path: api/.nx/cache
key: ${{ runner.os }}-nx-cache
restore-keys: ${{ runner.os }}-nx-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
Expand All @@ -46,8 +53,6 @@ jobs:
load: true
push: false
tags: betagouvpdc/${{ matrix.image.name }}:${{ env.tag }}
build-args: |
DOCKER_NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
labels: |
org.opencontainers.image.title=${{ matrix.image.name }} Image
org.opencontainers.image.source=${{ github.event.repository.html_url }}
Expand Down Expand Up @@ -82,8 +87,6 @@ jobs:
file: ${{ matrix.image.dockerfile }}
push: true
tags: betagouvpdc/${{ matrix.image.name }}:${{ env.tag }}
build-args: |
DOCKER_NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
labels: |
org.opencontainers.image.title=${{ matrix.image.name }} Image
org.opencontainers.image.source=${{ github.event.repository.html_url }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
with:
Expand Down
1 change: 1 addition & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist
.env
coverage
.nyc_output
.nx/cache
7 changes: 0 additions & 7 deletions api/lerna.json

This file was deleted.

26 changes: 15 additions & 11 deletions api/nx.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"$schema": "node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"options": {
"cacheableOperations": [
"build",
"test:unit"
]
}
"extends": "nx/presets/npm.json",
"targetDefaults": {
"build": {
"cache": true,
"dependsOn": ["^build"]
},
"test:unit": {
"cache": true
},
"coverage": {
"cache": true
}
},
"defaultBase": "main"
"affected": {
"defaultBase": "main"
},
"parallel": 16
}
Loading

0 comments on commit e765992

Please sign in to comment.