Skip to content

Workflow file for this run

on: pull_request
name: Continuous Integration
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v1
# use `--frozen-lockfile` to fail immediately if the committed yarn.lock needs updates
# https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-frozen-lockfile
- run: yarn --frozen-lockfile
- run: yarn lint
flow:
name: Flow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
- run: yarn --frozen-lockfile
- run: yarn flow check
benchmarks:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- name: PR Benchmarks
uses: parcel-bundler/parcel-benchmark-action@master
env:
PARCEL_BENCHMARK_APIKEY: ${{ secrets.PARCEL_BENCHMARK_APIKEY }}
unit_tests:
name: Unit tests (${{matrix.os}}, Node ${{matrix.node}})
strategy:
matrix:
node: [18, 20]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{matrix.node}}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Bump max inotify watches (Linux only)
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
if: ${{matrix.os == 'ubuntu-latest'}}
- run: yarn --frozen-lockfile
- run: yarn build-native-release
- run: yarn test:unit
- name: Upload @parcel/rust Linux Binaries artifact
if: ${{matrix.os == 'ubuntu-latest' && matrix.node == 20}}
uses: actions/upload-artifact@v2
with:
name: Rust Linux Binaries
path: |
packages/core/rust/index.d.ts
packages/core/rust/index.js
packages/core/rust/*.node
integration_tests:
name: Integration tests (${{matrix.os}}, Node ${{matrix.node}})
strategy:
matrix:
node: [18, 20]
os: [ubuntu-latest, macos-latest, windows-latest]
# These tend to be quite flakey, so one failed instance shouldn't stop
# others from potentially succeeding
fail-fast: false
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: ${{matrix.node}}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Bump max inotify watches (Linux only)
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
if: ${{matrix.os == 'ubuntu-latest'}}
- run: yarn --frozen-lockfile
- run: yarn build-native-release
- run: yarn build
- run: yarn test:integration-ci
# Similar to
# https://github.com/marketplace/actions/publish-unit-test-results#use-with-matrix-strategy
- name: Upload JUnit results
if: always()
uses: actions/upload-artifact@v2
with:
name: Integration tests (${{matrix.os}}, node ${{matrix.node}})
path: '**/junit-*.xml'
# Deployment steps taken from https://github.com/colinwilson/static-site-to-vercel/blob/master/.github/workflows/deploy-preview.yml
repl_build:
name: Build REPL
runs-on: ubuntu-latest
needs: [unit_tests]
permissions:
deployments: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 20
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install wasm-opt
run: |
curl -L -O https://github.com/WebAssembly/binaryen/releases/download/version_116/binaryen-version_116-x86_64-linux.tar.gz
tar -xf binaryen-version_116-x86_64-linux.tar.gz
echo "$PWD/binaryen-version_116/bin" >> $GITHUB_PATH
- uses: Swatinem/rust-cache@v1
with:
key: wasm
- name: Bump max inotify watches
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p;
- run: yarn --frozen-lockfile
- name: Download @parcel/rust Linux Binaries artifact
uses: actions/download-artifact@v3
with:
name: Rust Linux Binaries
path: packages/core/rust
- run: yarn build
- run: yarn build-native-wasm
- run: yarn workspace @parcel/repl build
# - name: Upload REPL
# uses: actions/upload-artifact@v2
# with:
# name: REPL
# path: 'packages/dev/repl/dist'
- name: Start Deployment
uses: bobheadxi/[email protected]
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
env: Preview
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
id: vercel-action
with:
vercel-token: ${{ secrets.REPL_VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.REPL_VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.REPL_VERCEL_PROJECT_ID }}
github-comment: false
working-directory: packages/dev/repl
# vercel-args: '--prod'
# alias-domains: |
# pr-{{PR_NUMBER}}.repl.parceljs.org
- name: Update Deployment Status
uses: bobheadxi/[email protected]
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: ${{ steps.vercel-action.outputs.preview-url }}
test_report:
name: Test report
runs-on: ubuntu-latest
needs: [unit_tests, integration_tests]
if: always()
steps:
- name: Create test report
uses: mikepenz/action-junit-report@v2
with:
report_paths: artifacts/**/*.xml