Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
feat: migrate to composite actions (#27)
Browse files Browse the repository at this point in the history
remove git utils and use nrwl/nx-set-shas action instead
closes #21, closes #22
  • Loading branch information
ronnetzer authored Mar 1, 2022
1 parent 63d9ccf commit 026026e
Show file tree
Hide file tree
Showing 66 changed files with 753 additions and 591 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/code-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- main
pull_request:
types:
- ready_for_review
schedule:
- cron: 0 0 * * 1

Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ jobs:
id: affected
with:
targets: 'test,build'
maxDistribution: 1

execute:
name: Run ${{ matrix.target }} ${{ matrix.distribution }}
name: Run ${{ matrix.target }}
if: ${{ fromJSON(needs.setup.outputs.hasChanges) }}
runs-on: ubuntu-latest
needs: [ setup ]
Expand All @@ -52,7 +53,6 @@ jobs:
id: execute
with:
target: ${{ matrix.target }}
distribution: ${{ matrix.distribution }}
projects: ${{ matrix.projects }}
nxCloud: true

Expand All @@ -71,10 +71,7 @@ jobs:
hasChanges: ${{ steps.affected.outputs.hasChanges || needs.setup.outputs.hasChanges }}
matrix: ${{ steps.affected.outputs.matrix || needs.setup.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/checkout@v2

- uses: e-square-io/.github/.github/actions/npm-ci@main

Expand All @@ -88,12 +85,12 @@ jobs:
uses: ./dist/packages/nx-affected-matrix
id: affected
with:
targets: 'build'
targets: build
maxDistribution: 1
debug: true

e2e-execute:
name: 'E2E nx-distributed-task [${{ matrix.target }} (${{ matrix.distribution }})]'
name: E2E nx-distributed-task [${{ matrix.target }} (${{ matrix.distribution }})]
if: ${{ fromJSON(needs.e2e-distribute.outputs.hasChanges) && (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && contains(needs.setup.outputs.matrix, 'nx-distributed-task') }}
needs: [setup,e2e-distribute]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -182,7 +179,7 @@ jobs:
if: ${{ contains(needs.setup.outputs.matrix, matrix.package) }}
uses: e-square-io/.github/.github/actions/push-to-repo@main
with:
path: 'dist/packages/${{ matrix.package }}'
path: dist/packages/${{ matrix.package }}
github-token: ${{ needs.release.outputs.github-token }}
version: ${{ needs.release.outputs.version }}
repository: ${{ matrix.package }}
6 changes: 0 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
## [2.1.5](https://github.com/e-square-io/nx-github-actions/compare/v2.1.4...v2.1.5) (2022-02-22)

### Build System

- update nx packages (#26) ([75aec2c](https://github.com/e-square-io/nx-github-actions/commit/75aec2cad472aa19729c15af1c11b6f3cd1936cf)), closes [#26](https://github.com/e-square-io/nx-github-actions/issues/26)

## [2.1.4](https://github.com/e-square-io/nx-github-actions/compare/v2.1.3...v2.1.4) (2022-02-19)

### Continuous Integration
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# NX Github Actions

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/e-square-io/nx-github-actions/Main%20Workflow?style=flat-square)](https://github.com/e-square-io/nx-github-actions/actions/workflows/main.yml)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/e-square-io/nx-github-actions/Main%20Workflow/main?event=push&logo=github&style=flat-square)](https://github.com/e-square-io/nx-github-actions/actions/workflows/main.yml)
[![Codecov](https://img.shields.io/codecov/c/github/e-square-io/nx-github-actions?logo=codecov&style=flat-square&token=PVPVUJAD1X)](https://app.codecov.io/gh/e-square-io/nx-github-actions)
[![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](.github/PULL_REQUEST_TEMPLATE.md)
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export const restoreCache = jest.fn().mockResolvedValue('test');

export const saveCache = jest.fn().mockResolvedValue('test');

export { ReserveCacheError } from '@actions/cache';
export const { ReserveCacheError } = jest.requireActual('@actions/cache');
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
...jest.requireActual('@actions/core'),
isDebug: jest.fn().mockReturnValue(false),
setFailed: jest.fn(),
saveState: jest.fn(),
setOutput: jest.fn(),
Expand Down
1 change: 1 addition & 0 deletions __mocks__/@actions/exec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const exec = jest.fn().mockResolvedValue(0);
File renamed without changes.
10 changes: 10 additions & 0 deletions __mocks__/@actions/glob.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const create = jest.fn(() =>
Promise.resolve({
glob: jest.fn().mockResolvedValue([]),
})
);

module.exports = {
...jest.requireActual('@actions/glob'),
create,
};
4 changes: 4 additions & 0 deletions __mocks__/@actions/io.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
...jest.requireActual('@actions/io'),
which: jest.fn(),
};
File renamed without changes.
2 changes: 2 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const nxPreset = require('@nrwl/jest/preset');

module.exports = {
...nxPreset,
roots: ['<rootDir>', `${__dirname}/__mocks__`],
clearMocks: true,
coverageReporters: ['json-summary', 'text', 'lcovonly'],
testEnvironment: 'node',
};
Loading

0 comments on commit 026026e

Please sign in to comment.