Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update to dev.97, workspaces, simplify test run #14

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 39 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on:
pull_request:
branches:
- main
push:
branches-ignore:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -58,28 +55,36 @@ jobs:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: ${{ matrix.project }}/package-lock.json
- name: Build for Cypress
- name: Run Cypress
uses: cypress-io/github-action@v6
if: matrix.project != 'react-app'
with:
working-directory: ${{ matrix.project }}
build: npm run build -- --logLevel error
runTests: false
browser: ${{ matrix.browser }}
start: npm start
- name: Run Cypress
if: matrix.project == 'react-app'
uses: cypress-io/github-action@v6
with:
working-directory: ${{ matrix.project }}
start: npm start
start: npm run serve
browser: ${{ matrix.browser }}
install: false
install: true
- uses: actions/upload-artifact@master
if: always()
with:
name: ${{ matrix.project}}-cypress-report
path: ${{ matrix.project }}/${{ matrix.project }}-cypress-report.xml
- uses: actions/upload-artifact@master
if: failure()
with:
name: screenshots
name: ${{ matrix.project }}-screenshots
path: ${{ matrix.project }}/cypress/screenshots
- uses: actions/upload-artifact@master
if: failure()
with:
name: videos
name: ${{ matrix.project }}-videos
path: ${{ matrix.project }}/cypress/videos
test-unit:
name: Test (Unit)
Expand All @@ -102,10 +107,30 @@ jobs:
- name: Install Dependencies
run: npm ci
- name: Run Unit Tests
run: npm test -- --reporter=xunit --reporter-options output=unit-tests.xml
- name: Report Results
uses: EnricoMi/publish-unit-test-result-action@v2
run: npm test -- --reporter=xunit --reporter-options output=${{matrix.project}}-unit-tests.xml
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (${{matrix.project}})
path: ${{matrix.project}}/${{matrix.project}}-unit-tests.xml
publish-test-results:
name: "Publish Tests Results"
needs:
- test-unit
- test-ui
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: |
${{ matrix.project }}/unit-tests.xml
files: "artifacts/**/*.xml"
5 changes: 5 additions & 0 deletions html-web-page/cypress.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import { defineConfig } from 'cypress';
const port = Number.parseInt(process.env.ROMCAL_APP_PORT ?? '3000', 10);

export default defineConfig({
reporter: 'junit',
reporterOptions: {
mochaFile: 'html-web-page-cypress-report.xml',
toConsole: true,
},
e2e: {
baseUrl: `http://localhost:${port}`,
supportFile: false,
Expand Down
2 changes: 1 addition & 1 deletion html-web-page/cypress/e2e/load.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Load', () => {

cy.get('#calendar').find('div').should('have.length', 2).as('messages');
cy.get('@messages').eq(0).should('have.text', 'All definitions, which are all possible liturgical days of a specific calendar, that can occur during a whole year:');
cy.get('@messages').eq(1).should('have.text', 'A calendar that contains all liturgical days occurring during 2024:');
cy.get('@messages').eq(1).should('have.text', `A calendar that contains all liturgical days occurring during ${new Date().getUTCFullYear()}:`);

cy.get('#calendar').find('pre').should('have.length', 2).as('codes');
cy.get('@codes').eq(0).should('include.text', 'mary_mother_of_god');
Expand Down
57 changes: 29 additions & 28 deletions html-web-page/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions html-web-page/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"name": "romcal-html-web-page-example",
"scripts": {
"prestart": "cp node_modules/romcal/dist/iife/romcal.js public/romcal/romcal.js && cp node_modules/@romcal/calendar.france/iife/fr.js public/romcal/fr.js",
"prestart": "cp ../node_modules/romcal/rites/roman1969/dist/iife/romcal.js public/romcal/romcal.js && cp node_modules/@romcal/calendar.france/iife/fr.js public/romcal/fr.js",
"start": "http-server -g -p ${ROMCAL_APP_PORT:-3000} ./public",
"build": "exit 0",
"test:ui": "cypress run"
"test:ui": "cypress run",
"dev:link": "ROMCAL_ALIAS=\"../${ROMCAL_ALIAS:-romcal}\" bash ../scripts/link.sh"
},
"dependencies": {
"@romcal/calendar.france": "3.0.0-dev.81",
"@romcal/calendar.general-roman": "3.0.0-dev.81",
"@romcal/calendar.france": "3.0.0-dev.97",
"@romcal/calendar.general-roman": "3.0.0-dev.97",
"http-server": "^14.1.1",
"romcal": "3.0.0-dev.81"
"romcal": "3.0.0-dev.97"
},
"license": "MIT",
"devDependencies": {
Expand Down
Loading
Loading