54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
name: Continuous Integration
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-docker:
|
|
name: Build Docker
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build service
|
|
run: docker build .
|
|
|
|
build-lint-test:
|
|
name: Build, Lint, and Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: package.json
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Unit tests
|
|
run: npm run test:run
|
|
|
|
- name: Integration tests
|
|
run: |
|
|
node dist/index.js --lineupId=USA-DITV751-X --timespan=3 --postalCode=80020 --outputFile=dtv.xml
|
|
node dist/index.js --lineupId=USA-OTA80020 --timespan=3 --postalCode=80020 --outputFile=ota.xml
|
|
|
|
# Error if they are the same
|
|
if cmp -s dtv.xml ota.xml; then
|
|
echo "DTV and OTA outputs are the same, which is unexpected."
|
|
exit 1
|
|
fi
|