Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add semantic release #212

Merged
merged 11 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ description: Run Build
runs:
using: "composite"
steps:
- name: update npm
run: npm install -g npm
shell: bash
- name: Install deps
run: npm ci
shell: bash

- name: Build and package the application
run: npm run build && npm pack
shell: bash
4 changes: 1 addition & 3 deletions .github/actions/es-lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ description: Run ESLint
runs:
using: "composite"
steps:
- name: update npm
run: npm install -g npm
shell: bash
- name: Install deps
run: npm ci
shell: bash

- name: Run lint tests
run: npm run test:lint
shell: bash
3 changes: 0 additions & 3 deletions .github/actions/functional-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ inputs:
runs:
using: "composite"
steps:
- name: update npm
run: npm install -g npm
shell: bash
- name: Run functional test
shell: bash
run: |
Expand Down
67 changes: 21 additions & 46 deletions .github/workflows/pull_request.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,79 +6,54 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v3
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@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ matrix.node-version }}
- uses: ./.github/actions/es-lint

build:
name: Build
runs-on: ubuntu-22.04
needs: [lint]
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
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@v3
with:
node-version: 18
node-version: ${{ matrix.node-version }}
- uses: ./.github/actions/build
- name: Store build archive as artifact
uses: actions/upload-artifact@v4
with:
name: kourou-build
name: kourou-build-${{ matrix.node-version }}
path: ./kourou-*.tgz

functional-test:
name: Functional Test - ${{ matrix.test-set }}
name: Functional Tests
runs-on: ubuntu-22.04
needs: [build]
strategy:
matrix:
node-version: [18, 20]
test-set: [stdout, cucumber]
steps:
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
NODE_ENV: test
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@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ matrix.node-version }}

- name: Recover previously built Kourou
uses: actions/download-artifact@v4
with:
name: kourou-build
name: kourou-build-${{ matrix.node-version }}

- name: Unpack and prepare artifact for tests
run: |
tar xfz ./kourou-*.tgz
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/push_branches.workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Run tests

on:
push:
branches:
- master
- beta

jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: ./.github/actions/es-lint

build:
name: Build
runs-on: ubuntu-22.04
needs: [lint]
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: ./.github/actions/build
- name: Store build archive as artifact
uses: actions/upload-artifact@v4
with:
name: kourou-build-${{ matrix.node-version }}
path: ./kourou-*.tgz

functional-test:
name: Functional Tests
runs-on: ubuntu-22.04
needs: [build]
strategy:
matrix:
node-version: [18, 20]
test-set: [stdout, cucumber]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Recover previously built Kourou
uses: actions/download-artifact@v4
with:
name: kourou-build-${{ matrix.node-version }}

- name: Unpack and prepare artifact for tests
run: |
tar xfz ./kourou-*.tgz
cp -fr .mocharc.json .nycrc tsconfig.json features test package/
- uses: ./.github/actions/functional-test
with:
test-set: ${{ matrix.test-set }}

release:
name: Release process
runs-on: ubuntu-22.04
needs: [functional-test]
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Install dependencies
run: |
npm clean-install
npm run build
npm clean-install --omit=dev

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.NPM_TOKEN }}
SEMANTIC_RELEASE_SLACK_WEBHOOK: ${{ secrets.SEMANTIC_RELEASE_SLACK_WEBHOOK }}
run: npx semantic-release
91 changes: 0 additions & 91 deletions .github/workflows/push_dev.workflow.yml

This file was deleted.

Loading
Loading