wip: Re-create fancyTree in React #395
This file contains hidden or 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 | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Read .nvmrc | |
| id: nvmrc | |
| run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Cypress run | |
| uses: cypress-io/github-action@v6 | |
| env: | |
| REACT_APP_AUTOSUBMIT_API_SOURCE: "http://localhost:8000" | |
| REACT_APP_DARK_MODE_SWITCHER: true | |
| REACT_APP_TOP_ANNOUNCEMENT: "Testing production version" | |
| REACT_APP_AUTHENTICATION: true | |
| CYPRESS_BASE_URL: "http://localhost:4173" # 4173 is the default port for vite preview | |
| CYPRESS_EXTERNAL_API: "http://localhost:8000" | |
| with: | |
| install-command: yarn install | |
| build: yarn build | |
| start: yarn preview | |
| wait-on: "http://localhost:4173" | |
| browser: chrome | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| browser: [chrome, firefox] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Read .nvmrc | |
| id: nvmrc | |
| run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Cypress run | |
| uses: cypress-io/github-action@v6 | |
| env: | |
| REACT_APP_AUTOSUBMIT_API_SOURCE: "http://localhost:8000" # This url is only used by the interceptor to mock the API | |
| REACT_APP_DARK_MODE_SWITCHER: true # Enable dark mode switcher | |
| REACT_APP_TOP_ANNOUNCEMENT: "Testing" # Set the announcement text | |
| REACT_APP_AUTHENTICATION: true # Enable authentication | |
| CYPRESS_BASE_URL: "http://localhost:3000" | |
| CYPRESS_EXTERNAL_API: "http://localhost:8000" | |
| with: | |
| install-command: yarn install | |
| start: yarn start | |
| wait-on: "http://localhost:3000" | |
| browser: ${{ matrix.browser }} | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage_${{ matrix.browser }} | |
| path: coverage/clover.xml | |
| retention-days: 7 | |
| coverage: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Download coverage artifacts | |
| uses: actions/download-artifact@v5 | |
| - name: Codecov upload | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| name: ${{ github.workflow }} | |
| flags: fast-tests | |
| fail_ci_if_error: true | |
| verbose: true | |
| # Token not required for public repos, but avoids upload failure due | |
| # to rate-limiting (but not for PRs opened from forks) | |
| token: ${{ secrets.CODECOV_TOKEN }} |