Pipeline versioning tests (#2028) #581
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI-MAIN | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [master] | |
workflow_dispatch: | |
inputs: | |
BUILD_ALL: | |
description: should build all repos | |
required: false | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
test_and_build: | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
services: | |
# Label used to access the service container | |
redis: | |
# Docker Hub image | |
image: redis | |
# Set health checks to wait until redis has started | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Opens tcp port 6379 on the host and service container | |
- 6379:6379 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- run: git fetch --prune --unshallow | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 18.x | |
- run: ./scripts/beforeInstall.sh | |
- run: | | |
npm ci | |
echo "$PWD/node_modules/.bin" >> $GITHUB_PATH | |
- name: bootstrap | |
run: | | |
export CHANGED=$(lerna changed --includeMergedTags)||true | |
if [ "$BUILD_ALL" = "true" ]; then | |
echo "Building all packages" | |
export CHANGED=$(lerna list) | |
fi | |
echo ${CHANGED} | |
# export CHANGED=${CHANGED:-$(lerna list)} | |
echo ${CHANGED} | xargs -n 1 -d ' ' -I {} lerna exec npm ci --scope {} | |
echo CHANGED=$CHANGED >> $GITHUB_ENV | |
env: | |
BUILD_ALL: '${{ github.event.client_payload.BUILD_ALL || github.event.inputs.BUILD_ALL }}' | |
- name: build and test | |
run: | | |
echo $CHANGED | |
if [ -z $CHANGED ]; | |
then | |
echo nothing changed | |
else | |
scripts/runTestAndBuild.sh | |
fi | |
env: | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
- name: trigger | |
if: env.CHANGED | |
id: trigger | |
uses: octokit/[email protected] | |
with: | |
route: POST /repos/kube-HPC/release-manager/dispatches | |
event_type: trigger | |
env: | |
GITHUB_TOKEN: '${{ secrets.GH_TOKEN }}' |