Release test Workflow #1
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
name: Release test Workflow | |
on: | |
workflow_dispatch: | |
jobs: | |
release_test: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run && github.event.workflow_run.conclusion == 'success' || true }} | |
environment: 'Release test' | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
GIT_USER: ${{ vars.GIT_USER }} | |
GIT_EMAIL: ${{ vars.GIT_EMAIL }} | |
RELEASE_BRANCH: ${{ github.event.workflow_run.head_branch || github.ref }} | |
SCOS_BASE_URL: ${{ secrets.SCOS_BASE_URL }} | |
FES_CONTENT_BACKEND_URL: ${{ secrets.FES_CONTENT_BACKEND_URL }} | |
STORE: ${{ vars.STORE }} | |
ORYX_FEATURE_VERSION: latest | |
steps: | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ env.GH_TOKEN }} | |
ref: ${{ env.RELEASE_BRANCH }} | |
submodules: recursive | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: npm-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
npm-node- | |
- name: Auth Git | |
run: | | |
git config user.email "${{ env.GIT_EMAIL }}" | |
git config user.name "${{ env.GIT_USER }}" | |
- name: Install Deps | |
run: npm ci | |
- name: Build packages | |
run: npx nx run-many --target=build --all --parallel=2 --exclude testfront,storybook,storefront | |
- name: Install verdaccio | |
run: npm i -g verdaccio | |
- name: Run verdaccio first time to generate config | |
run: verdaccio & | |
- name: Wait for verdaccio to start up | |
run: | | |
while ! nc -z localhost 4873; do | |
sleep 1 | |
done | |
- name: Stop verdaccio | |
run: kill -9 $(lsof -ti :4873) | |
- name: Allow to publish packages to everyone for verdaccio | |
run: | | |
if [ ! -f "$VERDACCIO_CONFIG" ]; then | |
echo "Creating Verdaccio config file: $VERDACCIO_CONFIG" | |
mkdir -p $(dirname "$VERDACCIO_CONFIG") | |
touch "$VERDACCIO_CONFIG" | |
fi | |
sed -i 's/\$authenticated/\$all/g' $VERDACCIO_CONFIG | |
env: | |
VERDACCIO_CONFIG: /home/runner/.config/verdaccio/config.yaml | |
- name: Run verdaccio again | |
run: verdaccio & | |
- name: Set npm registry for @oryx-frontend to verdaccio | |
run: npm config set @oryx-frontend:registry http://localhost:4873 | |
- name: Release test | |
run: npm run release-test | |
- name: Install dependencies for testfront | |
run: cd apps/testfront && npm i && npm list --depth=1 && cd ../.. | |
- name: Run e2e | |
run: npm run testfront:e2e | |
env: | |
SCOS_BASE_URL: ${{ env.SCOS_BASE_URL }} | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} |