fix(deps): pin dependencies #5324
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
name: ChromiumDriver CI | |
on: [push, pull_request] | |
jobs: | |
prepare_matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
versions: ${{ steps.generate-matrix.outputs.versions }} | |
steps: | |
- name: Select 3 most recent LTS versions of Node.js | |
id: generate-matrix | |
run: echo "versions=$(curl -s https://endoflife.date/api/nodejs.json | jq -c '[[.[] | select(.lts != false)][:3] | .[].cycle | tonumber]')" >> "$GITHUB_OUTPUT" | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: npm install | |
- name: ESLint | |
run: npm run lint | |
- name: Validate Renovate Config | |
uses: rinchsan/renovate-config-validator@1ea1e8514f6a33fdd71c40b0a5fa3512b9e7b936 # tag=v0 | |
with: | |
pattern: '{.renovaterc.json,renovate/default.json}' | |
test: | |
needs: | |
- lint | |
- prepare_matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }} | |
name: Tests | |
permissions: | |
contents: read | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm install | |
- name: Setup Chrome | |
uses: browser-actions/setup-chrome@latest | |
- name: Print Chrome version | |
if: ${{ runner.os != 'macOS' }} | |
run: chrome --version | |
- name: Print Chrome version (mac) | |
if: ${{ runner.os == 'macOS' }} | |
run: chromium --version | |
- name: Start Display | |
shell: bash | |
run: | | |
if ["$RUNNER_OS" == "Windows"]; then | |
echo "Not starting display since on Windows" | |
else | |
DISPLAY=:99 sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & | |
fi | |
- name: Run smoke, unit & E2E tests | |
shell: bash | |
run: | | |
if ["$RUNNER_OS" == "Windows"]; then | |
TEST_PLATFORM="$RUNNER_OS" npm run test:ci | |
else | |
DISPLAY=:99 TEST_PLATFORM="$RUNNER_OS" npm run test:ci | |
fi | |
release: | |
if: github.ref == 'refs/heads/main' | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- run: npm install --no-package-lock | |
name: Install dependencies | |
- run: npm run build | |
name: Run build | |
- run: | | |
rm -rf package-lock.json node_modules | |
# Remove dev and peer dependencies from node_modules | |
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 | |
- 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 }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
name: Release |