Skip to content

Release auth0-acul-js-0.0.1-beta.0 #55

Release auth0-acul-js-0.0.1-beta.0

Release auth0-acul-js-0.0.1-beta.0 #55

Workflow file for this run

name: Unit Tests
on:
pull_request:
paths:
- 'packages/auth0-acul-js/**'
- 'packages/ul-react-component/**'
- 'packages/ul-react/**'
push:
branches:
- master
paths:
- 'packages/auth0-acul-js/**'
- 'packages/ul-react-component/**'
- 'packages/ul-react/**'
permissions:
contents: read
pull-requests: read
concurrency:
group: “${{ github.workflow }}-${{ github.ref }}”
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
NODE_VERSION: 18
jobs:
determine-package:
name: Determine modified files
runs-on: ubuntu-latest
outputs:
auth0-acul-js-changed: ${{ steps.determine_package.outputs.auth0-acul-js-changed }}
ul-react-component-changed: ${{ steps.determine_package.outputs.ul-react-component-changed }}
ul-react-changed: ${{ steps.determine_package.outputs.ul-react-changed }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Determine affected packages
id: determine_package
shell: bash
run: |
auth0_acul_js_changed=false
ul_react_component_changed=false
ul_react_changed=false
if [ ${{ github.event.pull_request.changed_files }} -ne 0 ]; then
curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
"${{ github.event.pull_request.url }}/files" \
> files.json
cat files.json
jq -r '.[].filename' files.json > changed_files.txt
cat changed_files.txt
if grep -q "packages/auth0-acul-js/" changed_files.txt; then
auth0_acul_js_changed=true
fi
if grep -q "packages/ul-react-component/" changed_files.txt; then
ul_react_component_changed=true
fi
if grep -q "packages/ul-react/" changed_files.txt; then
ul_react_changed=true
fi
fi
echo "auth0-acul-js-changed=$auth0_acul_js_changed" >> $GITHUB_OUTPUT
echo "ul-react-component-changed=$ul_react_component_changed" >> $GITHUB_OUTPUT
echo "ul-react-changed=$ul_react_changed" >> $GITHUB_OUTPUT
auth0-acul-js-build:
needs: determine-package
if: ${{ needs.determine-package.outputs.auth0-acul-js-changed == 'true' }}
name: Build and Test auth0-acul-js
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
registry-url : "https://registry.npmjs.org"
- name: Install dependencies
shell: bash
working-directory: packages/auth0-acul-js
run: |
npm install --include=dev
continue-on-error: true
- name: Build package
shell: bash
working-directory: packages/auth0-acul-js
run: |
npm run build
- name: Run tests
shell: bash
working-directory: packages/auth0-acul-js
run: |
npm run test
ul-react-component-build:
needs: determine-package
if: ${{ needs.determine-package.outputs.ul-react-component-changed == 'true' }}
name: Build and Test ul-react-component
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
registry-url : "https://registry.npmjs.org"
- name: Install dependencies
shell: bash
working-directory: packages/ul-react-component
run: |
npm install --include=dev
- name: Build package
shell: bash
working-directory: packages/ul-react-component
run: |
npm run build
- name: Run tests
shell: bash
working-directory: packages/ul-react-component
run: |
npm run test
ul-react-build:
needs: determine-package
if: ${{ needs.determine-package.outputs.ul-react-changed == 'true' }}
name: Build and Test ul-react
runs-on: ubuntu-22.04-2cpu-8ram-75ssd
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
registry-url : "https://registry.npmjs.org"
- name: Install dependencies
shell: bash
working-directory: packages/ul-react
run: |
npm install --include=dev
- name: Build package
shell: bash
working-directory: packages/ul-react
run: |
npm run build
- name: Run tests
shell: bash
working-directory: packages/ul-react
run: |
npm run test
notify:
needs:
- auth0-acul-js-build
- ul-react-component-build
- ul-react-build
runs-on: ubuntu-latest
if: always()
steps:
- name: Notify Status
run: echo "All relevant package tests completed."