-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add CLI tests to CI pipeline (#380)
- Loading branch information
Showing
4 changed files
with
180 additions
and
163 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
* @foo | ||
|
||
|
||
#################################### Generated content - do not edit! #################################### | ||
# This block has been generated with codeowners-generator (for more information https://github.com/gagoar/codeowners-generator) | ||
# Don't worry, the content outside this block will be kept. | ||
|
||
# Rule extracted from dir1/CODEOWNERS | ||
/dir1/**/* @bar | ||
|
||
#################################### Generated content - do not edit! #################################### |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Test CLI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
- name: Install npm dependencies | ||
run: npm ci | ||
- name: Build and package project | ||
run: | | ||
npm run build | ||
npm run build-cli | ||
npm pack | ||
- name: Upload project artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: built-project | ||
path: codeowners-generator-*.tgz | ||
retention-days: 5 | ||
test: | ||
name: Test | ||
needs: build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-latest | ||
- ubuntu-latest | ||
- windows-latest | ||
node-version: | ||
- 12 | ||
- 14 | ||
- 16 | ||
- 18 | ||
- 20 | ||
- 21 | ||
steps: | ||
- name: Set git to use LF | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: Download project artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: built-project | ||
path: . | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install project | ||
shell: bash | ||
run: npm i -g codeowners-generator-*.tgz | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Test CLI | ||
shell: bash | ||
working-directory: ./.github/test-cli-mock-project | ||
run: | | ||
echo "::group::Show CODEOWNERS content" | ||
cat CODEOWNERS | ||
echo "" | ||
echo "::endgroup::" | ||
echo "::group::Get Version" | ||
codeowners-generator --version | ||
echo "::endgroup::" | ||
echo "::group::Check CODEOWNERS content" | ||
codeowners-generator generate --check | ||
echo "::endgroup::" |
Oops, something went wrong.