fix(deps): update all dependencies (patch) #6310
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code quality | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
pull_request: | |
concurrency: | |
cancel-in-progress: true | |
group: quality-${{ github.ref }} | |
jobs: | |
register-elastic: | |
name: Register elasticsearch | |
runs-on: ubuntu-latest | |
steps: | |
- uses: socialgouv/workflows/actions/build-image@v1 | |
with: | |
imageName: cdtn/elasticsearch | |
token: ${{ secrets.GITHUB_TOKEN }} | |
dockerfile: "./docker/elasticsearch/Dockerfile" | |
dockercontext: "./docker/elasticsearch" | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "yarn" | |
- name: Install dependencies | |
run: | | |
yarn install --immutable | |
- name: Build code | |
run: | | |
yarn build | |
- name: Cache build | |
uses: actions/cache@v3 | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
needs: [build] | |
strategy: | |
fail-fast: false | |
matrix: | |
repositories: | |
["@socialgouv/cdtn-ui", "@cdt/frontend", "@socialgouv/modeles-social"] | |
steps: | |
- uses: actions/cache@v3 | |
name: Restore build | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
- name: Lint ${{ matrix.repositories }} | |
run: | | |
yarn workspace ${{ matrix.repositories }} lint --quiet | |
build-storybook: | |
name: Build Storybook | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/cache@v3 | |
name: Restore build | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
- name: Build Storybook | |
run: yarn workspace @socialgouv/cdtn-ui build-storybook | |
type-check: | |
name: Check typescript types | |
runs-on: ubuntu-latest | |
needs: [build] | |
strategy: | |
fail-fast: false | |
matrix: | |
repositories: | |
[ | |
"@cdt/frontend", | |
"@socialgouv/modeles-social", | |
"@socialgouv/cdtn-utils", | |
"@socialgouv/cdtn-ui", | |
] | |
steps: | |
- uses: actions/cache@v3 | |
name: Restore build | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
- name: Type-check ${{ matrix.repositories }} | |
run: | | |
yarn workspace ${{ matrix.repositories }} type-check | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: [register-elastic, build] | |
services: | |
elasticsearch: | |
image: ghcr.io/socialgouv/cdtn/elasticsearch:sha-${{ github.sha }} | |
ports: | |
- 9200:9200 | |
env: | |
ES_JAVA_OPTS: "-Xms256m -Xmx256m" | |
options: >- | |
--health-cmd "curl -sS http://localhost:9200/_cat/health?h=status" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 6 | |
strategy: | |
fail-fast: false | |
matrix: | |
repositories: | |
["@socialgouv/cdtn-ui", "@cdt/frontend", "@socialgouv/modeles-social"] | |
steps: | |
- uses: actions/cache@v3 | |
name: Restore build | |
with: | |
path: ./* | |
key: ${{ github.sha }} | |
- name: Test ${{ matrix.repositories }} | |
run: | | |
yarn workspace ${{ matrix.repositories }} test | |
env: | |
ELASTICSEARCH_URL: http://localhost:9200 | |
docker: | |
name: Lint Dockerfile | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Lint Dockerfile | |
uses: hadolint/[email protected] | |
with: | |
recursive: true |