From da25978c19cf0853622f6ff3aace5ce1aeea8a2d Mon Sep 17 00:00:00 2001 From: rolljee Date: Wed, 29 Nov 2023 11:40:06 +0100 Subject: [PATCH] Update requested changes --- .github/workflows/codeql.yml | 2 +- .github/workflows/core-dev.workflow.yml | 2 +- .github/workflows/elasticsearch.workflow.yml | 2 +- .github/workflows/kuzzle-runner.workflow.yml | 74 +++----------------- .github/workflows/workflow-deployments.yaml | 6 +- .github/workflows/workflow.yaml | 30 ++++---- 6 files changed, 30 insertions(+), 86 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e124fa7729..23bc12e6bd 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -11,7 +11,7 @@ on: jobs: analyze: name: Analyze - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: actions: read contents: read diff --git a/.github/workflows/core-dev.workflow.yml b/.github/workflows/core-dev.workflow.yml index e11ee75b98..15f68ab919 100644 --- a/.github/workflows/core-dev.workflow.yml +++ b/.github/workflows/core-dev.workflow.yml @@ -11,7 +11,7 @@ env: jobs: build-and-push: name: Build and push core-dev image - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/elasticsearch.workflow.yml b/.github/workflows/elasticsearch.workflow.yml index 8ed9278392..ce5c466880 100644 --- a/.github/workflows/elasticsearch.workflow.yml +++ b/.github/workflows/elasticsearch.workflow.yml @@ -12,7 +12,7 @@ env: jobs: build-and-push: name: Build and push elasticsearch image - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/kuzzle-runner.workflow.yml b/.github/workflows/kuzzle-runner.workflow.yml index 712a355d0a..38c595cdfd 100644 --- a/.github/workflows/kuzzle-runner.workflow.yml +++ b/.github/workflows/kuzzle-runner.workflow.yml @@ -7,43 +7,17 @@ on: env: DOCKER_PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7" - NODE_LTS_MAINTENANCE_VERSION: "16" - NODE_LTS_ACTIVE_VERSION: "18" - NODE_LTS_CURRENT_VERSION: "20" jobs: + publish-runner: + name: Build and push image embedding Node.js + runs-on: ubuntu-22.04 + maintenance: name: Build and deploy image embedding Node.js maintenance LTS - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: ./kuzzle-runner - file: ./kuzzle-runner/Dockerfile - push: true - build-args: NODE_LTS_VERSION=${{ env.NODE_LTS_MAINTENANCE_VERSION }} - platforms: ${{ env.DOCKER_PLATFORMS }} - tags: kuzzleio/kuzzle-runner:${{ env.NODE_LTS_MAINTENANCE_VERSION }},kuzzleio/kuzzle-runner:maintenance - - active: - name: Build and deploy image embedding Node.js active LTS version - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 + matrix: + node-version: [16, 18, 20] steps: - uses: actions/checkout@v3 @@ -66,36 +40,6 @@ jobs: context: ./kuzzle-runner file: ./kuzzle-runner/Dockerfile push: true - build-args: NODE_LTS_VERSION=${{ env.NODE_LTS_ACTIVE_VERSION }} + build-args: NODE_LTS_VERSION=${{ matrix.node-version }} platforms: ${{ env.DOCKER_PLATFORMS }} - tags: kuzzleio/kuzzle-runner:${{ env.NODE_LTS_ACTIVE_VERSION }},kuzzleio/kuzzle-runner:active,kuzzleio/kuzzle-runner:latest - - # Node 20 is not currently supported, this will be uncommented in a upcomming PR - # current: - # name: Build and deploy image embedding Node.js latest LTS version - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - - # - name: Set up Docker Buildx - # id: buildx - # uses: docker/setup-buildx-action@v3 - - # - name: Login to DockerHub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKER_USERNAME }} - # password: ${{ secrets.DOCKER_PASSWORD }} - - # - name: Build and push - # uses: docker/build-push-action@v3 - # with: - # context: ./kuzzle-runner - # file: ./kuzzle-runner/Dockerfile - # push: true - # build-args: NODE_LTS_VERSION=${{ env.NODE_LTS_CURRENT_VERSION }} - # platforms: ${{ env.DOCKER_PLATFORMS }} - # tags: kuzzleio/kuzzle-runner:${{ env.NODE_LTS_CURRENT_VERSION }},kuzzleio/kuzzle-runner:current + tags: kuzzleio/kuzzle-runner:${{ matrix.node-version }} \ No newline at end of file diff --git a/.github/workflows/workflow-deployments.yaml b/.github/workflows/workflow-deployments.yaml index b6e8732639..88e0a04e7f 100644 --- a/.github/workflows/workflow-deployments.yaml +++ b/.github/workflows/workflow-deployments.yaml @@ -77,7 +77,7 @@ jobs: doc-deploy: name: Documentation - Deploy if: ${{ (github.event_name != 'workflow_dispatch' || inputs.doc_deploy) && (github.ref_name == 'master' || github.ref_name == '2-dev') }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout project uses: actions/checkout@v3 @@ -102,7 +102,7 @@ jobs: dockerhub-deploy: name: Build and deploy images to Dockerhub if: ${{ (github.event_name != 'workflow_dispatch' || inputs.dockerhub_deploy) && github.ref_name == 'master' }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout project uses: actions/checkout@v3 @@ -153,7 +153,7 @@ jobs: npm-deploy: name: Build and deploy release on NPM.js if: ${{ (github.event_name != 'workflow_dispatch' || inputs.npm_deploy) && github.ref_name == 'master' }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout project uses: actions/checkout@v3 diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 088d74a552..6694ab5aac 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -16,11 +16,11 @@ env: jobs: prepare-matrix: name: Forge Node LTS Matrix - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - id: set-matrix run: | - echo "matrix={\"node-version\": [\"$NODE_LTS_MAINTENANCE_VERSION\", \"$NODE_LTS_ACTIVE_VERSION\"]}" >> $GITHUB_OUTPUT + echo 'node-version=["$NODE_LTS_MAINTENANCE_VERSION", "$NODE_LTS_ACTIVE_VERSION"]' >> $GITHUB_OUTPUT outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} node_lts_maintenance_version: ${{ env.NODE_LTS_MAINTENANCE_VERSION }} @@ -30,7 +30,7 @@ jobs: error-codes-check: name: Documentation - Error codes check - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout project uses: actions/checkout@v3 @@ -52,11 +52,11 @@ jobs: lint: name: Lint - Node.js LTS ${{ matrix.node-version }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [prepare-matrix] strategy: matrix: - node-version: ${{ fromJson(needs.prepare-matrix.outputs.matrix).node-version }} + node-version: ${{ needs.prepare-matrix.outputs.node-version }} steps: - name: Checkout project uses: actions/checkout@v3 @@ -78,8 +78,8 @@ jobs: needs: [lint, prepare-matrix] strategy: matrix: - node-version: ${{ fromJson(needs.prepare-matrix.outputs.matrix).node-version }} - runs-on: ubuntu-latest + node-version: ${{ needs.prepare-matrix.outputs.node-version }} + runs-on: ubuntu-22.04 steps: - name: Checkout project uses: actions/checkout@v3 @@ -105,10 +105,10 @@ jobs: build-and-run-kuzzle: needs: [unit-tests, prepare-matrix] name: Build and Run - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: - node-version: ${{ fromJson(needs.prepare-matrix.outputs.matrix).node-version }} + node-version: ${{ needs.prepare-matrix.outputs.node-version }} kuzzle-image: ["kuzzle"] steps: - name: Checkout project @@ -142,8 +142,8 @@ jobs: "legacy:http", "legacy:websocket", ] - node-version: ${{ fromJson(needs.prepare-matrix.outputs.matrix).node-version }} - runs-on: ubuntu-latest + node-version: ${{ needs.prepare-matrix.outputs.node-version }} + runs-on: ubuntu-22.04 steps: - name: Checkout project uses: actions/checkout@v3 @@ -156,10 +156,10 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: "npm" - + - name: Install depedencies run: npm ci - + - name: Build kuzzle run: npm run build @@ -174,10 +174,10 @@ jobs: cluster-monkey-tests: name: Cluster Monkey Tests needs: [functional-tests, build-and-run-kuzzle, prepare-matrix] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: - node-version: ${{ fromJson(needs.prepare-matrix.outputs.matrix).node-version }} + node-version: ${{ needs.prepare-matrix.outputs.node-version }} steps: - name: Checkout project uses: actions/checkout@v3