GitHub actions #40
Workflow file for this run
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: Landonlite Frontend Workflow | |
on: | |
pull_request: | |
branches: | |
- "master" | |
jobs: | |
compare-changes: | |
uses: ./.github/workflows/compare-changes.yml | |
print-compare-changes-output: | |
runs-on: ubuntu-latest | |
needs: compare-changes | |
steps: | |
- run: echo "FrontendDisable ${{ needs.compare-changes.outputs.frontendDisable }}" | |
- run: printf "should run frontend CI ${{ needs.compare-changes.outputs.frontendDisable == 'false' }}\n" | |
frontend-test: | |
needs: | |
- compare-changes | |
if: ${{ needs.compare-changes.outputs.frontendDisable == 'false' }} | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./web | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Cache npm packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm install | |
- name: Run tests | |
run: npm test |