Skip to content

chore(deps): bump actions/cache from 3 to 4 #69

chore(deps): bump actions/cache from 3 to 4

chore(deps): bump actions/cache from 3 to 4 #69

Workflow file for this run

name: Node CI
on:
push:
branches:
- "**"
tags:
- "v**"
pull_request:
jobs:
lint-core:
name: Typecheck and Lint
runs-on: ubuntu-latest
continue-on-error: true
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
- uses: ./.github/actions/setup-meteor
- name: restore node_modules
uses: actions/cache@v4
with:
path: |
meteor/node_modules
key: ${{ runner.os }}-${{ hashFiles('meteor/yarn.lock') }}-${{ hashFiles('meteor/.meteor/release') }}
- name: Prepare Environment
run: |
yarn
env:
CI: true
- name: Run typecheck and linter
run: |
cd meteor
meteor npm run ci:lint
env:
CI: true
test-core:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
- uses: ./.github/actions/setup-meteor
- name: restore node_modules
uses: actions/cache@v4
with:
path: |
meteor/node_modules
key: ${{ runner.os }}-${{ hashFiles('meteor/yarn.lock') }}-${{ hashFiles('meteor/.meteor/release') }}
- name: Prepare Environment
run: |
yarn
env:
CI: true
- name: Run Tests
run: |
cd meteor
meteor yarn unitci
env:
CI: true
- name: Send coverage
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
# name: codecov-umbrella
build-core:
# TODO - should this be dependant on tests or something passing if we are on a tag?
name: Build and publish docker image
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Determine images to publish
id: image-tags
run: |
IMAGES=
DOCKER_TAG=$(echo "${{ github.ref_name }}" | sed -r 's/[^a-z0-9]+/-/gi')
# check if a release branch, or master, or a tag
if [[ $DOCKER_TAG =~ ^release([0-9]+)$ || $DOCKER_TAG == "master" || $DOCKER_TAG == "main" || "${{ github.ref }}" == refs/tags/* ]]
then
# If we have a dockerhub image name, then setup to publish there
if [ -z "${{ secrets.DOCKERHUB_IMAGE_PREFIX }}" ]
then
DOCKERHUB_PUBLISH="0"
else
DOCKERHUB_PUBLISH="1"
IMAGES="${{ secrets.DOCKERHUB_IMAGE_PREFIX }}e2e-test-runner:$DOCKER_TAG"$'\n'$IMAGES
fi
# If instructed, push to github packages
if [ -z "${{ secrets.GH_PACKAGES_ENABLED }}" ] || [ -z "${{ secrets.GITHUB_TOKEN }}" ]
then
GHCR_PUBLISH="0"
else
GHCR_PUBLISH="1"
IMAGES="ghcr.io/${{ github.repository }}:$DOCKER_TAG"$'\n'$IMAGES
fi
# debug output
echo dockerhub-publish $DOCKERHUB_PUBLISH
echo ghcr-publish $GHCR_PUBLISH
echo images $IMAGES
echo "images=$IMAGES" >> $GITHUB_OUTPUT
echo "dockerhub-publish=$DOCKERHUB_PUBLISH" >> $GITHUB_OUTPUT
echo "ghcr-publish=$GHCR_PUBLISH" >> $GITHUB_OUTPUT
else
echo "Skipping docker build"
fi
- name: Use Node.js
uses: actions/setup-node@v4
if: ${{ steps.image-tags.outputs.images }}
with:
node-version-file: ".node-version"
- uses: ./.github/actions/setup-meteor
if: ${{ steps.image-tags.outputs.images }}
- name: Prepare Environment
if: ${{ steps.image-tags.outputs.images }}
run: |
yarn install
- name: Persist Built Version information
if: ${{ steps.image-tags.outputs.images }}
run: |
cd meteor
yarn inject-git-hash
- name: Meteor Build
if: ${{ steps.image-tags.outputs.images }}
run: |
cd meteor
NODE_OPTIONS="--max-old-space-size=4096" METEOR_DEBUG_BUILD=1 meteor build --allow-superuser --directory .
- name: Meteor Bundle NPM Build
if: ${{ steps.image-tags.outputs.images }}
run: |
cd meteor/bundle/programs/server
meteor npm install
- name: Set up Docker Buildx
if: ${{ steps.image-tags.outputs.images }}
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: steps.image-tags.outputs.images && steps.image-tags.outputs.dockerhub-publish == '1'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: steps.image-tags.outputs.images && steps.image-tags.outputs.ghcr-publish == '1'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
if: ${{ steps.image-tags.outputs.images }}
with:
context: .
file: ./meteor/Dockerfile.gha
push: true
tags: ${{ steps.image-tags.outputs.images }}