Files
fleet/.github/workflows/test-fleet-agent-downloader-changes.yml
T
EricandCopilot b6a3c546ef Add test and deploy workflows for ee/fleet-agent-downloader (#43343)
Related to: https://github.com/fleetdm/fleet/issues/40309

Changes:
- Added two workflows to test changes and deploy the
ee/fleet-agent-downloader app on Heroku.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-09 15:26:24 -05:00

59 lines
1.9 KiB
YAML

on:
pull_request:
paths:
- 'ee/fleet-agent-downloader/**'
- '.github/workflows/test-fleet-agent-downloader-changes.yml'
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id}}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
permissions:
contents: read
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Harden Runner
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
# Set the Node.js version
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: ${{ matrix.node-version }}
# Now start building!
# > …but first, get a little crazy for a sec and delete the top-level package.json file
# > i.e. the one used by the Fleet server. This is because require() in node will go
# > hunting in ancestral directories for missing dependencies, and since some of the
# > bundled transpiler tasks sniff for package availability using require(), this trips
# > up when it encounters another Node universe in the parent directory.
- run: rm -rf package.json package-lock.json node_modules/
# > Turns out there's a similar issue with how eslint plugins are looked up, so we
# > delete the top level .eslintrc file too.
- run: rm -f .eslintrc.js
# Get dependencies (including dev deps)
- run: cd ee/fleet-agent-downloader/ && npm install
# Run sanity checks
- run: cd ee/fleet-agent-downloader/ && npm test
# Compile assets
- run: cd ee/fleet-agent-downloader/ && npm run build-for-prod