Skip to content

Commit

Permalink
Add GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikprijck committed Nov 9, 2023
1 parent 19ddd90 commit b9e424c
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build application
description: Build the example application

inputs:
working_directory:
description: The current working directory
required: true

runs:
using: composite

steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
shell: bash
run: npm ci
working-directory: ${{ inputs.working_directory }}

- name: Build
shell: bash
run: npm run build
working-directory: ${{ inputs.working_directory }}

- name: Tests
shell: bash
working-directory: ${{ inputs.working_directory }}
57 changes: 57 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build

on:
merge_group:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
- chore/github-actions

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
NODE_VERSION: 18
CACHE_KEY: '${{ github.ref }}-${{ github.run_id }}-${{ github.run_attempt }}'

jobs:
sample-01:
name: Build Sample
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- run: git clone https://github.com/auth0-samples/spa-quickstarts-tests scripts

- name: Build Sample
uses: ./.github/actions/build
with:
working_directory: Sample-01
standalone:
name: Build Standalone
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- run: git clone https://github.com/auth0-samples/spa-quickstarts-tests scripts

- name: Build Standalone
uses: ./.github/actions/build
with:
working_directory: Standalone

0 comments on commit b9e424c

Please sign in to comment.