Skip to content

Commit

Permalink
fix: workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sethyates committed Aug 30, 2022
1 parent e561be4 commit 83ef516
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 62 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ on:
jobs:
check-dist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Checkout
uses: actions/checkout@v3
- name: Set Node
uses: actions/setup-node@v3
with:
node-version: 16.x

node-version: 16
cache: 'npm'
scope: conventional-actions
registry-url: https://npm.pkg.github.com/
always-auth: true
- name: Install dependencies
run: npm ci

- name: Rebuild the dist/ directory
run: |
npm run all
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
Expand All @@ -38,10 +38,16 @@ jobs:
exit 1
fi
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/

env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

permissions:
packages: read
20 changes: 18 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
scope: conventional-actions
registry-url: https://npm.pkg.github.com/
always-auth: true
- run: npm ci
- run: npm run all

env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

permissions:
packages: read
110 changes: 60 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"@types/node": "^18.7.13",
"@typescript-eslint/parser": "^5.35.1",
"@vercel/ncc": "^0.34.0",
"eslint": "^8.22.0",
"eslint": "^8.23.0",
"eslint-plugin-github": "^4.3.7",
"eslint-plugin-jest": "^26.8.7",
"eslint-plugin-jest": "^27.0.1",
"jest": "^28.1.3",
"js-yaml": "^4.1.0",
"prettier": "^2.7.1",
Expand Down

0 comments on commit 83ef516

Please sign in to comment.