diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..8373557 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,7 @@ +on: [push, workflow_dispatch] + +jobs: + run-tests: + uses: ./.github/workflows/tests.yml + build: + uses: ./.github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d04c4e..067549b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c4b8e05..32bbc4a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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