Move to Sveltekit #9
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: CI - Pull Request | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- 'src/**' | |
- 'tests/**' | |
- 'static/**' | |
- 'Dockerfile' | |
- '.github/workflows/ci-pr-build-test.yml' | |
- 'yarn.lock' | |
workflow_dispatch: | |
jobs: | |
cache-install: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.11.0 | |
- name: Cache yarn dependencies | |
uses: actions/cache@v3 | |
id: cache-dependencies | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install Dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: | | |
yarn install --frozen-lockfile | |
build: | |
needs: [cache-install] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out Repo | |
uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.11.0 | |
- name: Restore yarn depdendencies | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Build | |
run: | | |
yarn build | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-output | |
path: build | |
retention-days: 1 | |
test: | |
needs: cache-install | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.11.0 | |
- name: Restore yarn depdendencies | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Run Tests | |
run: | | |
yarn ci | |
# - name: Generate Allure Test Report | |
# uses: simple-elf/allure-report-action@master | |
# if: always() | |
# with: | |
# allure_results: allure-results | |
# subfolder: test-results | |
# allure_report: allure-report | |
# allure_history: allure-history | |
# keep_reports: 100 | |
# - name: Generate badges | |
# run: | | |
# node generate-badges.js | |
# - name: Upload badges artifacts | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: badges-output | |
# path: badges | |
# retention-days: 1 | |
# - name: Upload tests artifacts | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: tests-output | |
# path: allure-history | |
# retention-days: 1 | |
# - name: Upload coverage artifacts | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: coverage-output | |
# path: coverage | |
# retention-days: 1 |