Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Disable strict packages locking #412

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,15 @@ name: Node.js CI
on: [push, pull_request]

jobs:
# https://thekevinwang.com/2021/09/19/github-actions-dynamic-matrix/
prepare_matrix:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.generate-matrix.outputs.versions }}
steps:
- name: Generate Node.js versions matrix
- name: Select 3 most recent LTS versions of Node.js
id: generate-matrix
run: |
sudo apt-get install -y lynx
lynx -dump https://endoflife.date/nodejs | grep -E -o '[0-9]+[( a-zA-Z]+LTS\)' | grep -E -o '([0-9]+)' > eol.list
cat eol.list
lts1=$(cat eol.list | head -1)
lts2=$(cat eol.list | head -2 | tail -1)
lts3=$(cat eol.list | head -3 | tail -1)
VERSIONS="[$lts1, $lts2, $lts3]"
echo ::set-output name=versions::${VERSIONS}
run: echo "versions=$(curl -s https://endoflife.date/api/nodejs.json | jq -c '[[.[] | select(.lts != false)][:3] | .[].cycle | tonumber]')" >> "$GITHUB_OUTPUT"


build:
runs-on: ubuntu-latest
Expand All @@ -33,8 +25,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: |
npm ci || npm install
- run: npm install
name: Install dev dependencies
- run: npm run lint
name: Linter
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/publish.js.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
name: Release

on:
Expand All @@ -9,17 +10,25 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 18.x
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: lts/*
check-latest: true
- run: npm install --no-package-lock
name: Install dev dependencies
- run: npm run build
name: Run build
name: Install dependencies
- run: npm run test
name: Run unit tests
name: Run NPM Test
- run: |
rm -rf node_modules package-lock.json
npm prune --omit=dev --omit=peer --no-package-lock
name: Remove dev dependencies and appium peer dependencies
- run: npm shrinkwrap --omit=dev --omit=peer
name: Create shrinkwrap
# "--no-package-lock" prevent adding dev dependencies in the shrinkwrap
- run: npm install --only=dev --no-package-lock
name: Install dev dependencies for the release
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
build
*.log
.idea
package-lock.json*
Loading