Skip to content

Run commitlint on pull requests #2343

Run commitlint on pull requests

Run commitlint on pull requests #2343

Workflow file for this run

name: ci:build
on:
push:
branches:
- main
pull_request:
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: Continuous integration (build)
strategy:
matrix:
platform:
- ubuntu-latest
architecture:
- os.linux.x86_64
runs-on: ${{ matrix.platform }}
timeout-minutes: 15
outputs:
node-version: ${{ steps.meteor-node.outputs.version }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Install 💾
uses: meteor-actions/install@v3
- name: Get Meteor's Node version
id: meteor-node
run: |
echo \
"version=$(meteor node --version | tail -c +2)" \
>> "$GITHUB_OUTPUT"
- name: Cache build 💽
uses: meteor-actions/cache-build@v3
with:
key: build
- name: Build 🏗️
run: |
meteor npm run build -- ./dist --directory --architecture ${{ matrix.architecture }} --server-only
- name: Compress build 🧶
run: |
tar czf dist.tar.gz --directory dist/bundle .
- name: Archive build 💽
uses: actions/upload-artifact@v4
with:
name: artifacts
path: dist.tar.gz
retention-days: 1
test:
needs:
- build
strategy:
matrix:
platform:
- ubuntu-latest
architecture:
- linux-x64
runs-on: ${{ matrix.platform }}
timeout-minutes: 1
steps:
- name: Load build 💽
uses: actions/download-artifact@v4
with:
name: artifacts
path: artifacts
- uses: actions/setup-node@v4
id: setup-node
with:
node-version: ${{ needs.build.outputs.node-version }}
continue-on-error: true
- name: Install nvm
if: ${{ steps.setup-node.outcome != 'success' }}
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="${HOME}/.nvm"
echo "NVM_DIR=${NVM_DIR}" >> "$GITHUB_ENV"
- name: Install Meteor-specific Node version via nvm
if: ${{ steps.setup-node.outcome != 'success' }}
env:
ARCH: ${{ matrix.architecture }}
NODE_VERSION: ${{ needs.build.outputs.node-version }}
NVM_DIR: ${{ env.NVM_DIR }}
run: |
export NODE_INSTALL_PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}"
curl "https://static.meteor.com/dev-bundle-node-os/v${NODE_VERSION}/node-v${NODE_VERSION}-${ARCH}.tar.gz" | tar xzf - -C /tmp/
mkdir -p "${NODE_INSTALL_PATH}"
rm -r "${NODE_INSTALL_PATH}"
mv "/tmp/node-v${NODE_VERSION}-${ARCH}" "${NODE_INSTALL_PATH}"
- name: Use Meteor-specific Node version via nvm
if: ${{ steps.setup-node.outcome != 'success' }}
env:
NODE_VERSION: ${{ needs.build.outputs.node-version }}
NVM_DIR: ${{ env.NVM_DIR }}
run: |
source "${NVM_DIR}/nvm.sh"
nvm use "${NODE_VERSION}"
export NODE_PATH="$(dirname $(nvm which $(node --version)))"
echo "${NODE_PATH}" >> "$GITHUB_PATH"
- name: Inflate build 🧥
run: |
mkdir -p dist
tar xzf artifacts/dist.tar.gz --directory dist
- name: Inspect build
run: |
ls -la dist
- name: Inspect build
run: |
cat dist/README
- name: Inspect build
run: |
ls -la dist/server
- name: Inspect build
run: |
cat dist/star.json
- name: Inspect build
run: |
ls -la dist/programs
- name: Inspect build
run: |
ls -la dist/programs/server
- name: Check node version
run: |
diff dist/.node_version.txt <(node --version)
diff <(jq -r .nodeVersion dist/star.json) <(node --version | tail -c +2)
continue-on-error: true
- name: Check npm version
run: |
diff <(npm --version) <(jq -r .npmVersion dist/star.json)
- name: Install dependencies
run: |
cd dist/programs/server
npm install
- name: Run server
env:
ROOT_URL: http://localhost
PORT: 3000
run: |
cd dist
node main.js