Skip to content

Commit

Permalink
Merge pull request #728 from kuzzleio/feat/semantic-release
Browse files Browse the repository at this point in the history
feat(semantic-release): add semantic release support and workflow files
  • Loading branch information
rolljee authored Aug 30, 2023
2 parents 2257670 + 2e439ab commit 63968e9
Show file tree
Hide file tree
Showing 150 changed files with 1,348 additions and 109,202 deletions.
50 changes: 0 additions & 50 deletions .ci/test-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,3 @@ docker-compose -f ./doc/docker-compose.yml pull
docker-compose -f ./doc/docker-compose.yml run doc-tests node index
EXIT=$?
docker-compose -f ./doc/docker-compose.yml down

docker-compose -f ./doc/docker-compose.yml up -d kuzzle

until $(curl --output /dev/null --silent --head --fail http://localhost:7512); do
printf '.'
sleep 5
done

cd ${here}/../doc/7/getting-started/.react/with-redux
npm ci
SKIP_PREFLIGHT_CHECK=true npm run start &
until $(curl --output /dev/null --silent --head --fail http://localhost:3000); do
printf '.'
sleep 5
done
npm run test
kill $(lsof -t -i:3000)

cd ${here}/../doc/7/getting-started/.react/standalone
npm ci
SKIP_PREFLIGHT_CHECK=true npm run start &
until $(curl --output /dev/null --silent --head --fail http://localhost:3000); do
printf '.'
sleep 5
done
npm run test

cd ${here}/../doc/7/getting-started/.vuejs
npm ci
npm run serve-standalone &
until $(curl --output /dev/null --silent --head --fail http://localhost:8080); do
printf '.'
sleep 5
done
npm run test

cd ${here}/../doc/7/getting-started/.react-native
# Here we use install instead of ci because expo-cli cannot be installed with ci
npm install
npm run web &
until $(curl --output /dev/null --silent --head --fail http://localhost:19006); do
printf '.'
sleep 5
done
npm run test

cd ${here}
docker-compose -f ./doc/docker-compose.yml down

exit $EXIT
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
3 changes: 3 additions & 0 deletions .cz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "./node_modules/cz-conventional-changelog"
}
43 changes: 0 additions & 43 deletions .github/actions/tests-ac/action.yml

This file was deleted.

100 changes: 32 additions & 68 deletions .github/workflows/pull_request.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ on: [pull_request]
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: ["16", "18"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
Expand All @@ -19,19 +22,22 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: "14"
node-version: ${{ matrix.node-version }}
- uses: ./.github/actions/es-lint

unit-tests:
name: Unit Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
needs: [lint]
strategy:
matrix:
node-version: ["16", "18"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
Expand All @@ -41,21 +47,24 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: "14"
node-version: ${{ matrix.node-version }}
- uses: ./.github/actions/unit-tests

functional-tests:
name: Functional Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
needs: [unit-tests]
strategy:
matrix:
node-version: ["16", "18"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
Expand All @@ -65,69 +74,24 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: "14"
node-version: ${{ matrix.node-version }}
- uses: ./.github/actions/functional-tests
with:
CYPRESS_RECORD_KEY_DOC: ${{ secrets.CYPRESS_RECORD_KEY_DOC }}

admin-console-tests:
name: Admin Console Tests
runs-on: ubuntu-22.04
needs: [unit-tests]
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: "14"
- uses: ./.github/actions/tests-ac
with:
sdk-version: 7
cypress-key: ${{ secrets.CYPRESS_RECORD_KEY }}

# doc-dead-links:
# name: Check dead-links
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Extract references from context
# shell: bash
# id: extract-refs
# run: |
# echo "::set-output name=version::$(git describe --abbrev=0 --tags | cut -d. -f 1)"
# echo "::set-output name=repo::$(echo $GITHUB_REPOSITORY | cut -d/ -f 2)"
# echo "::set-output name=fw-branch::$(if [ $BASE_BRANCH == master ]; then echo master; else echo develop; fi)"
# - uses: convictional/trigger-workflow-and-wait@v1.3.0
# with:
# owner: kuzzleio
# repo: documentation
# github_token: ${{ secrets.ACCESS_TOKEN_CI }}
# workflow_file_name: dead_links.workflow.yml
# ref: ${{ steps.extract-refs.outputs.fw-branch }}
# inputs: '{"repo_name": "${{ steps.extract-refs.outputs.repo }}", "branch": "${{ github.head_ref }}", "version": "${{ steps.extract-refs.outputs.version }}"}'

documentation-snippet-tests:
name: Documentation Snippet Tests
needs: [unit-tests]
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: ["16", "18"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
Expand All @@ -137,9 +101,9 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: "14"
node-version: ${{ matrix.node-version }}
- uses: ./.github/actions/snippet-tests
with:
CYPRESS_RECORD_KEY_DOC: ${{ secrets.CYPRESS_RECORD_KEY_DOC }}
55 changes: 55 additions & 0 deletions .github/workflows/push_branches.workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Push checks

on:
push:
branches:
- master
- beta

jobs:
release:
name: Release process
runs-on: ubuntu-20.04
permissions:
contents: write
issues: write
pull-requests: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
scope: '@kuzzleio'

- name: Install dependencies
run: npm ci

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GHP }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
SEMANTIC_RELEASE_NPM_PUBLISH: "true"
SEMANTIC_RELEASE_SLACK_WEBHOOK: ${{ secrets.SEMANTIC_RELEASE_SLACK_WEBHOOK }}
run: npx semantic-release

documentation_deploy:
needs: [release]
name: Documentation - Deploy
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: convictional/trigger-workflow-and-wait@v1.6.3
with:
owner: kuzzleio
repo: documentation
github_token: ${{ secrets.ACCESS_TOKEN_CI }}
workflow_file_name: child_repo.workflow.yml
ref: ${{ github.ref_name == 'master' && 'master' || 'develop' }}
client_payload: '{"repo_name":"sdk-javascript","branch":"${{ github.ref_name }}","version":"1"}'
Loading

0 comments on commit 63968e9

Please sign in to comment.