Skip to content

create initial integration test workflow (#8) #6

create initial integration test workflow (#8)

create initial integration test workflow (#8) #6

name: Build and Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
core-library:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm test
- uses: actions/upload-artifact@v3
with:
name: core-library-artifacts-node${{ matrix.node-version }}
path: dist/*
cloudflare:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: core-library
defaults:
run:
working-directory: ./bindings/cloudflare
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: actions/download-artifact@v3
with:
name: core-library-artifacts-node${{ matrix.node-version }}
path: dist
- run: echo "Current directory - $(pwd)"
- run: npm ci
- run: npm run build
- run: npm run build:worker
- run: npm test
- uses: actions/upload-artifact@v3
with:
name: cloudflare-artifacts-node${{ matrix.node-version }}
path: bindings/cloudflare/dist/*
fastly:
runs-on: ubuntu-latest
timeout-minutes: 15
needs: core-library
defaults:
run:
working-directory: ./bindings/fastly
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: actions/download-artifact@v3
with:
name: core-library-artifacts-node${{ matrix.node-version }}
path: dist
- run: |
# Download and install latest fastly CLi version
# TODO: find and parse latest version of Fastly CLI
# This may be possible using the github REST API to list assets in a release
# and fetching the one matching the fastly_<VERSION>_linux_amd64.deb pattern.
wget https://github.com/fastly/cli/releases/download/v10.15.0/fastly_10.15.0_linux_amd64.deb
sudo dpkg -i fastly_10.15.0_linux_amd64.deb
sudo apt-get update
sudo apt-get install -y --fix-missing
- run: npm i
- run: npm run build
- uses: actions/upload-artifact@v3
with:
name: fastly-artifacts-node${{ matrix.node-version }}
path: bindings/fastly/dist/*
# TODO: fix tests
# - run: npm test