I have 3 repos, A,B and C. A is the parent. In the A repo i have a github action, see below.
Package B and C are in package A.
Is it possible and how can i achive to run npm test for repo B en C BEFORE i run the test for repo A?
on:
push:
tags:
- '*'
name: 🚀 Deploy website on create tag
jobs:
web-deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: '14'
registry-url: 'https://registry.npmjs.org'
scope: '@xxxxxx'
- name: 🔨 NPM install en build prod
run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > .npmrc
- run: npm ci
- run: npm run build
- run: npm run test
- name: Copy public dir to production
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{secrets.SSH_PRIVATE_KEY}}
port: ${{secrets.SSH_PORT}}
command_timeout: 30s
source: "./public"
target: "/var/www/html/"
2
Answers
I found the solution.
And the rest...
You could define a job for each testing step A,B and C described here. In the code below B and C are each in their own working-directory (/B and /C) within the repository A.
B and C run in parallel. After BOTH have completed successfully job A is run. (Based on your code, not tested)