Skip to content

Commit

Permalink
chore: Improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Oğuzhan Durgun <[email protected]>
  • Loading branch information
oguzhand95 committed Oct 9, 2024
1 parent 58c6758 commit 77d584d
Show file tree
Hide file tree
Showing 27 changed files with 34,660 additions and 49,559 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

55 changes: 0 additions & 55 deletions .eslintrc.json

This file was deleted.

66 changes: 18 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,29 @@ on:
- main

jobs:
buildtest:
name: Build and Unit Test
build-test-check-and-use:
name: Build, Test, Check and Use
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Set Node.js 20
uses: actions/setup-node@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
node-version: 20.x

- name: Print Node.js and npm version
run: |
node --version
npm --version
- run: |
npm install
- run: |
npm run all
use:
name: Use
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set Node.js 20
uses: actions/setup-node@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
node-version: 20.x
- name: Set up pnpm
uses: pnpm/action-setup@v3

- name: Print Node.js and npm version
run: |
node --version
npm --version
- uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

checkdist:
name: Check dist/index.js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set Node.js 20
- name: Set up Node.js
uses: actions/setup-node@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
node-version: 20.x
node-version-file: '.node-version'

- name: Install dependencies
run: npm ci --legacy-peer-deps
run: |
pnpm install --frozen-lockfile
- name: Rebuild the dist/ directory
run: npm run build
- name: Run all
run: |
npm run all
- name: Compare the expected and actual dist/ directories
run: |
Expand All @@ -73,3 +38,8 @@ jobs:
exit 1
fi
id: diff

- name: Use action
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.18.0
5 changes: 2 additions & 3 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Building cerbos-setup-action


```
npm run build && npm run format && npm run lint && npm run package && npm test
pnpm run format && pnpm run lint && pnpm run build && pnpm test
```

`npm run package` will create or overwrite the `dist/index.js` and `dist/index.js` which is the executable part of the GitHub Action.
`pnpm run build` will create or overwrite the `dist/index.js` and `dist/index.js` which is the executable part of the GitHub Action.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,21 @@ steps:
github_token: <github_token>
version: latest
```
## Development
### Prerequisites
You'll need to install
- Node.js, matching the version specified in our [.node-version](../.node-version) file
- A version manager that supports this file is recommended, for example [n](https://github.com/tj/n#readme).
Note that [nvm](https://github.com/nvm-sh/nvm) [does not](https://github.com/nvm-sh/nvm/issues/794).
- pnpm, matching the version specified in our [package.json](./package.json) file
- After installing Node.js, you can enable [Corepack](https://nodejs.org/api/corepack.html) to transparently install the correct `pnpm` version:
```console
$ corepack enable
```
57 changes: 0 additions & 57 deletions __tests__/get-url-to-download.test.ts

This file was deleted.

46 changes: 0 additions & 46 deletions __tests__/get-version.test.ts

This file was deleted.

22 changes: 0 additions & 22 deletions __tests__/validate.test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ inputs:

runs:
using: 'node20'
main: 'dist/index.js'
main: './dist/index.js'
Loading

0 comments on commit 77d584d

Please sign in to comment.