Skip to content

Commit

Permalink
ci: compile for dist, remove node_modules
Browse files Browse the repository at this point in the history
* Use ncc to create `dist/index.js`, as recommended in:
  https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#commit-tag-and-push-your-action-to-github
* Remove `node_modules` from repo
* Point action.yml at `dist/index.js`
* Add a job to `workflows/test.yml` to ensure `dist/index.js` is updated.
* Remove unused `express` and `mocha` dependencies
  • Loading branch information
mchenryc authored and deblockt committed Jun 3, 2022
1 parent 9d8d244 commit 60602f8
Show file tree
Hide file tree
Showing 6,679 changed files with 13,647 additions and 530,526 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
29 changes: 28 additions & 1 deletion .github/workflows/test.yml
Expand Up @@ -8,10 +8,37 @@ on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run build
- name: Confirm new build included in commit
# language=bash
run: |
# Confirm that the dist was built, and changes included in the commit
if [ $(git status --porcelain dist/index.js | wc -l) -eq "1" ]; then
echo "::error title=Build not committed::Running 'npm run build' changes 'dist/index.js' - build locally and add changes to commit."
exit 1
fi
direct-from-repository-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Confirm execution without install/build
uses: ./
with:
name: "Successful cucumber report direct from repository"
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report.json" # This committed report should be a success

ubuntu-action-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- run: npm ci
- run: npm run cucumber || true
- run: npm run cucumber-ok || true
- run: npm run cucumber-undefined || true
Expand Down
24 changes: 24 additions & 0 deletions .gitignore
@@ -0,0 +1,24 @@
# Dependency directory
node_mdules/

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# IDE
*.iml
.idea/
4 changes: 2 additions & 2 deletions action.yml
Expand Up @@ -43,5 +43,5 @@ inputs:
default: 'Cucumber report'

runs:
using: 'node12'
main: 'index.js'
using: 'node16'
main: 'dist/index.js'

0 comments on commit 60602f8

Please sign in to comment.