Skip to content

Commit

Permalink
ci: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Badisi committed Jul 11, 2024
1 parent 7ba014c commit 8c21f1e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 133 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,17 @@ jobs:
ci_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: latest
registry-url: https://registry.npmjs.org/
cache: npm
cache-dependency-path: package-lock.json

- name: Install latest npm
run: npm install -g npm@latest
- name: Setup
uses: dsi-hug/actions/setup@v2

- name: Build docs
working-directory: projects/docs
run: |
npm clean-install --engine-strict
npm run build
run: npm run build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.DSI_HUG_BOT_GITHUB_TOKEN }}
publish_dir: ./projects/docs/build
user_name: dsi-hug-bot
user_email: dsi-hug-[email protected]
user_email: 'dsi-hug-[email protected]'
55 changes: 0 additions & 55 deletions .github/workflows/ci_publish.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release library

on:
release:
types: [created]

jobs:
ci_release:
uses: dsi-hug/actions/.github/workflows/action.yml@v2
secrets:
NPM_TOKEN: ${{ secrets.DSI_HUG_NPM_TOKEN }}
with:
working-directory: projects/lib
lint: true
test: true
build: false
release: true
69 changes: 9 additions & 60 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,26 @@
name: Run tests

on:
workflow_dispatch:
push:
branches:
- '**'
tags-ignore:
- '**'
paths-ignore:
- 'projects/docs/**'
pull_request:
workflow_call:
workflow_dispatch:

env:
HUSKY: 0

concurrency:
group: run-tests-group-${{ github.ref }}
cancel-in-progress: true

jobs:
ci_tests:
name: Tests on ${{ matrix.os }} node${{ matrix.node }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [18, 20]

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org/
cache: npm

# https://github.com/actions/setup-node/issues/411
# https://github.com/npm/cli/issues/4341
- name: Workaround for npm installation on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: npm install -g [email protected]

- name: Install latest npm
run: npm install -g npm@latest

- name: Cache .angular and node_modules
uses: actions/cache@v4
id: cache-step
with:
key: cache-${{ matrix.os }}-node${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
cache-${{ matrix.os }}-node${{ matrix.node }}-
path: |
.angular/cache
node_modules
- name: Install dependencies
if: steps.cache-step.outputs.cache-hit != 'true'
run: npm clean-install --engine-strict

- name: Lint
working-directory: projects/lib
run: npm run lint

- name: Test
working-directory: projects/lib
run: npm run test:ci

- name: Build
working-directory: projects/lib
run: npm run build
uses: dsi-hug/actions/.github/workflows/action.yml@v2
with:
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]'
node-versions: '[18, 20]'
working-directory: projects/lib
lint: true
test: true
build: true
3 changes: 2 additions & 1 deletion projects/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"test": "node ./make.mjs test-lib",
"test:ci": "node ./make.mjs test-ci",
"build": "node ./make.mjs build",
"build:global": "node ./make.mjs build-global"
"build:global": "node ./make.mjs build-global",
"release": "npm publish ./dist --access public"
},
"peerDependencies": {
"@angular-devkit/core": ">= 17",
Expand Down

0 comments on commit 8c21f1e

Please sign in to comment.