Skip to content

Commit

Permalink
build: add github actions config
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Dec 1, 2023
1 parent 5753e35 commit 0bbeeed
Show file tree
Hide file tree
Showing 12 changed files with 199 additions and 352 deletions.
11 changes: 11 additions & 0 deletions .github/actions/cypress-cache/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Cypress runner cache
description: Retrieve and cache the cypress runner
runs:
using: "composite"
steps:
# cache cypress runner
- uses: actions/cache@v3
id: cypress-cache
with:
path: /home/runner/.cache/Cypress
key: cypress-runner-cache-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
14 changes: 14 additions & 0 deletions .github/actions/lint/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint project
description: verify linting rules
runs:
using: "composite"
steps:
- uses: nrwl/nx-set-shas@v3
- uses: './.github/actions/node-cache'
- name: Install deps
shell: bash
run: npm i
- name: Lint affected
shell: bash
run: npx nx affected -t lint

12 changes: 12 additions & 0 deletions .github/actions/node-cache/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Node modules cache
description: Retrieve and cache project node_modules
runs:
using: "composite"
steps:
# cache node modules for all jobs to use
- uses: actions/cache@v3
id: node_modules-cache
with:
path: |
**/node_modules
key: install-cache-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
48 changes: 48 additions & 0 deletions .github/actions/release/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release job
description: build affected packages and publish them to npm
inputs:
npm_token:
description: 'NPM token'
required: true
gh_token:
description: 'Github token'
required: true
gh_actor:
description: 'Github actor'
required: true
runs:
using: "composite"
steps:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- uses: './.github/actions/node-cache'
- name: Install deps
shell: bash
run: npm i
- name: git config
shell: bash
run: |
git config user.name "${{ inputs.gh_actor }}"
git config user.email "${{ inputs.gh_actor }}@users.noreply.github.com"
- name: Build
shell: bash
run: npx nx run-many -t build
- name: Set publish config
env:
NPM_TOKEN: ${{ inputs.npm_token }}
shell: bash
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
- name: Version
shell: bash
env:
GH_TOKEN: ${{ inputs.gh_token }}
GITHUB_TOKEN: ${{ inputs.gh_token }}
run: npx nx affected --base=last-release --parallel=1 --target=version --postTargets=syncDependencies,npm,github --trackDeps
- name: Tag last-release
shell: bash
run: |
git tag -f last-release
git push origin last-release --force
16 changes: 16 additions & 0 deletions .github/actions/test-e2e/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: E2E tests
description: verify e2e tests
runs:
using: "composite"
steps:
- uses: nrwl/nx-set-shas@v3
- uses: './.github/actions/node-cache'
- uses: './.github/actions/cypress-cache'
- uses: './.github/actions/webpack-cache'
- name: Install deps
shell: bash
run: npm i
- name: Run e2e tests
shell: bash
run: npx nx run test-app-e2e:e2e --ci

14 changes: 14 additions & 0 deletions .github/actions/test-unit/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Unit tests
description: verify unit tests
runs:
using: "composite"
steps:
- uses: nrwl/nx-set-shas@v3
- uses: './.github/actions/node-cache'
- name: Install deps
shell: bash
run: npm i
- name: Test affected
shell: bash
run: npx nx affected -t test --configuration=ci

12 changes: 12 additions & 0 deletions .github/actions/webpack-cache/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Webpack dev server cache
description: Cache for e2e test runs
runs:
using: "composite"
steps:
# cache node modules for all jobs to use
- uses: actions/cache@v3
id: webpack-cache
with:
path: |
**/.webpack-cache
key: webpack-cache-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
# cache node modules for all jobs to use
- uses: './.github/actions/node-cache'
# cache cypress runner
- uses: './.github/actions/cypress-cache'
- name: Install deps
run: npm ci
lint:
needs: [install]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: './.github/actions/lint'
test:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: './.github/actions/test-unit'
build:
runs-on: ubuntu-latest
needs: [install]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- uses: './.github/actions/node-cache'
- name: Install deps
run: npm i
- name: Build affected
run: npx nx affected -t build
test-e2e:
runs-on: ubuntu-latest
needs: [install, build]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: './.github/actions/test-e2e'
release:
runs-on: ubuntu-latest
needs: [install, lint, test, build, test-e2e]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: './.github/actions/release'
with:
gh_token: ${{ secrets.GITHUB_TOKEN }}
npm_token: ${{ secrets.NPM_TOKEN }}
gh_actor: ${GITHUB_ACTOR}
11 changes: 0 additions & 11 deletions examples/test-app-e2e/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@
# Changelog

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [1.0.6](https://github.com/Hyperkid123/nxtesting/compare/v1.0.5...v1.0.6) (2023-11-28)

## [1.0.5](https://github.com/Hyperkid123/nxtesting/compare/v1.0.4...v1.0.5) (2023-11-28)

## [1.0.4](https://github.com/Hyperkid123/nxtesting/compare/v1.0.3...v1.0.4) (2023-11-28)

## [1.0.3](https://github.com/Hyperkid123/nxtesting/compare/v1.0.2...v1.0.3) (2023-11-28)

## [1.0.3](https://github.com/Hyperkid123/nxtesting/compare/v1.0.2...v1.0.3) (2023-11-28)
11 changes: 0 additions & 11 deletions examples/test-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@
# Changelog

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [1.0.6](https://github.com/Hyperkid123/nxtesting/compare/v1.0.5...v1.0.6) (2023-11-28)

## [1.0.5](https://github.com/Hyperkid123/nxtesting/compare/v1.0.4...v1.0.5) (2023-11-28)

## [1.0.4](https://github.com/Hyperkid123/nxtesting/compare/v1.0.3...v1.0.4) (2023-11-28)

## [1.0.3](https://github.com/Hyperkid123/nxtesting/compare/v1.0.2...v1.0.3) (2023-11-28)

## [1.0.3](https://github.com/Hyperkid123/nxtesting/compare/v1.0.2...v1.0.3) (2023-11-28)
141 changes: 0 additions & 141 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,142 +1 @@
# Changelog

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [1.0.16](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.15...@mmnxtest/core-1.0.16) (2023-11-30)


### Bug Fixes

* **core:** update ([88c43a4](https://github.com/Hyperkid123/nxtesting/commit/88c43a4b97ab1608a5dc43a31d83ff53aec7e322))

## [1.0.15](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.14...@mmnxtest/core-1.0.15) (2023-11-30)

## [1.0.14](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.13...@mmnxtest/core-1.0.14) (2023-11-30)


### Bug Fixes

* **core:** should trigger all ([2b888ec](https://github.com/Hyperkid123/nxtesting/commit/2b888ec0238770ef14c364b852c9757be0597b98))

## [1.0.13](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.12...@mmnxtest/core-1.0.13) (2023-11-30)


### Bug Fixes

* **core:** should trigger all ([ca277e7](https://github.com/Hyperkid123/nxtesting/commit/ca277e74bd7996d0fa6e80dfcc2b784ee8576e22))

## [1.0.12](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.11...@mmnxtest/core-1.0.12) (2023-11-30)

## [1.0.11](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.10...@mmnxtest/core-1.0.11) (2023-11-30)

## [1.0.10](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.9...@mmnxtest/core-1.0.10) (2023-11-30)


### Bug Fixes

* **core:** should release everything ([3c336de](https://github.com/Hyperkid123/nxtesting/commit/3c336deb1ad49afaffb34864d6cb327cdc407e6d))

## [1.0.9](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.8...@mmnxtest/core-1.0.9) (2023-11-28)


### Bug Fixes

* **core:** patch ([084540d](https://github.com/Hyperkid123/nxtesting/commit/084540d3ea4ef150a9622864be24af0b0c6fdef1))
* update ([fc8552b](https://github.com/Hyperkid123/nxtesting/commit/fc8552b7fb3bb9437521b5d46dee22e0a13c6113))

## [1.0.6](https://github.com/Hyperkid123/nxtesting/compare/v1.0.5...v1.0.6) (2023-11-28)

## [1.0.5](https://github.com/Hyperkid123/nxtesting/compare/v1.0.4...v1.0.5) (2023-11-28)


### Bug Fixes

* update ([fc8552b](https://github.com/Hyperkid123/nxtesting/commit/fc8552b7fb3bb9437521b5d46dee22e0a13c6113))

## [1.0.4](https://github.com/Hyperkid123/nxtesting/compare/v1.0.3...v1.0.4) (2023-11-28)


### Bug Fixes

* **core:** patch ([084540d](https://github.com/Hyperkid123/nxtesting/commit/084540d3ea4ef150a9622864be24af0b0c6fdef1))

## [1.0.3](https://github.com/Hyperkid123/nxtesting/compare/v1.0.2...v1.0.3) (2023-11-28)


### Bug Fixes

* add build post target ([3d88659](https://github.com/Hyperkid123/nxtesting/commit/3d886599e905ec21bdeca96f67f050dc43087435))
* add enable trackDeps option ([32dfe24](https://github.com/Hyperkid123/nxtesting/commit/32dfe24a94f4511a96f369ea4becae0688371ecf))
* add postTarget cli option ([53e405f](https://github.com/Hyperkid123/nxtesting/commit/53e405f13c9ff270fb9bd1ebd2d313501d0dd453))
* add push options for CI deployment ([56a1815](https://github.com/Hyperkid123/nxtesting/commit/56a18155d9dac9040feb2cb53b67fcb014781904))
* **core:** update core lib ([dd8594a](https://github.com/Hyperkid123/nxtesting/commit/dd8594ace0f3ae3f7fb5ee36bbc445f311daa19a))
* enable dependency tracking ([15ce7bc](https://github.com/Hyperkid123/nxtesting/commit/15ce7bc5bed789e3a72515bc222b5d678e3c66a6))
* enable dependency tracking ([f101c4a](https://github.com/Hyperkid123/nxtesting/commit/f101c4acc4db78180f2c79f790c6aa01a4bdf7c0))

## [1.0.3](https://github.com/Hyperkid123/nxtesting/compare/v1.0.2...v1.0.3) (2023-11-28)


### Bug Fixes

* add build post target ([3d88659](https://github.com/Hyperkid123/nxtesting/commit/3d886599e905ec21bdeca96f67f050dc43087435))
* add enable trackDeps option ([32dfe24](https://github.com/Hyperkid123/nxtesting/commit/32dfe24a94f4511a96f369ea4becae0688371ecf))
* add postTarget cli option ([53e405f](https://github.com/Hyperkid123/nxtesting/commit/53e405f13c9ff270fb9bd1ebd2d313501d0dd453))
* add push options for CI deployment ([56a1815](https://github.com/Hyperkid123/nxtesting/commit/56a18155d9dac9040feb2cb53b67fcb014781904))
* **core:** update core lib ([dd8594a](https://github.com/Hyperkid123/nxtesting/commit/dd8594ace0f3ae3f7fb5ee36bbc445f311daa19a))
* enable dependency tracking ([15ce7bc](https://github.com/Hyperkid123/nxtesting/commit/15ce7bc5bed789e3a72515bc222b5d678e3c66a6))
* enable dependency tracking ([f101c4a](https://github.com/Hyperkid123/nxtesting/commit/f101c4acc4db78180f2c79f790c6aa01a4bdf7c0))

## [1.0.7](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.6...@mmnxtest/core-1.0.7) (2023-11-28)


### Bug Fixes

* add enable trackDeps option ([32dfe24](https://github.com/Hyperkid123/nxtesting/commit/32dfe24a94f4511a96f369ea4becae0688371ecf))

## [1.0.6](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.5...@mmnxtest/core-1.0.6) (2023-11-28)


### Bug Fixes

* **core:** update core lib ([dd8594a](https://github.com/Hyperkid123/nxtesting/commit/dd8594ace0f3ae3f7fb5ee36bbc445f311daa19a))

## [1.0.5](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.4...@mmnxtest/core-1.0.5) (2023-11-28)


### Bug Fixes

* enable dependency tracking ([15ce7bc](https://github.com/Hyperkid123/nxtesting/commit/15ce7bc5bed789e3a72515bc222b5d678e3c66a6))
* enable dependency tracking ([f101c4a](https://github.com/Hyperkid123/nxtesting/commit/f101c4acc4db78180f2c79f790c6aa01a4bdf7c0))

## [1.0.5](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.4...@mmnxtest/core-1.0.5) (2023-11-28)


### Bug Fixes

* enable dependency tracking ([f101c4a](https://github.com/Hyperkid123/nxtesting/commit/f101c4acc4db78180f2c79f790c6aa01a4bdf7c0))

## [1.0.4](https://github.com/Hyperkid123/nxtesting/compare/@mmnxtest/core-1.0.3...@mmnxtest/core-1.0.4) (2023-11-27)


### Bug Fixes

* add push options for CI deployment ([56a1815](https://github.com/Hyperkid123/nxtesting/commit/56a18155d9dac9040feb2cb53b67fcb014781904))

## 0.1.0 (2023-11-27)


### Features

* **all:** initial commit ([125124a](https://github.com/Hyperkid123/nxtesting/commit/125124a52f6c026740879cf4ca2afdffe152afb6))


### Bug Fixes

* add build post target ([3d88659](https://github.com/Hyperkid123/nxtesting/commit/3d886599e905ec21bdeca96f67f050dc43087435))
* change ([2789590](https://github.com/Hyperkid123/nxtesting/commit/27895906d0db9257204b958fe2b48c1708a9ae8d))
* **core:** testing comming fix ([96365bd](https://github.com/Hyperkid123/nxtesting/commit/96365bdd21b045449c9f60f9a03049495db811de))
* **core:** update text ([723061f](https://github.com/Hyperkid123/nxtesting/commit/723061fca0331d80739463b8c7f2e329485a944f))
* fix extra space in project names ([49832c1](https://github.com/Hyperkid123/nxtesting/commit/49832c150e0b535044bd0d60cbc427a4e4eed2b1))
* **names:** change testing name ([4e75298](https://github.com/Hyperkid123/nxtesting/commit/4e75298228ce9ac5a13c9cd396bdcf301adfd636))
* udpate cross dependecies ([4261719](https://github.com/Hyperkid123/nxtesting/commit/42617196da7972f8a9db499860949fe41589da46))
* use free org name ([d917746](https://github.com/Hyperkid123/nxtesting/commit/d9177460ebeef193190b21ecc3a2c819674882a2))
Loading

0 comments on commit 0bbeeed

Please sign in to comment.