Skip to content

Commit

Permalink
CI: Test reusable actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mintoo200 committed Mar 14, 2024
1 parent 8e2a9e1 commit bb9c2e0
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 42 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
on: [push, workflow_dispatch]

jobs:
run-tests:
uses: ./.github/workflows/tests.yml
build:
uses: ./.github/workflows/build.yml
47 changes: 22 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
name: 'Run tests'
name: 'Build'

on: [push, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
# TODO: add version to a .nvmrc or at least a variable
node-version: 18.12.1
cache: npm
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: lib-${{ github.sha }}
path: ./dist
if-no-files-found: error
runs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
# TODO: add version to a .nvmrc or at least a variable
node-version: 18.12.1
cache: npm
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: lib-${{ github.sha }}
path: ./dist
if-no-files-found: error
31 changes: 14 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: 'Run tests'

on: [push, workflow_dispatch]

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
runs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
# TODO: add version to a .nvmrc or at least a variable
node-version: 18.12.1
cache: npm
- name: Install
run: npm ci --prefer-offline
- name: Run tests
run: npm run test:unit
node-version: 18.12.1
cache: npm
- name: Install
run: npm ci --prefer-offline
- name: Run tests
run: npm run test:unit

0 comments on commit bb9c2e0

Please sign in to comment.