diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml new file mode 100644 index 00000000..9a42b42c --- /dev/null +++ b/.github/workflows/acceptance.yml @@ -0,0 +1,51 @@ +name: Acceptance tests +on: [push] + +env: + ADDON_NAME: "@rohberg/volto-searchkit-block" + ADDON_PATH: "volto-searchkit-block" + VOLTO_VERSION: "16" + +jobs: + acceptance: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Install Cypress + run: | + cd acceptance + yarn + + - name: "Cypress: Acceptance tests" + uses: cypress-io/github-action@v5 + env: + BABEL_ENV: production + CYPRESS_RETRIES: 2 + with: + parallel: false + browser: chrome + working-directory: acceptance + spec: cypress/tests/*.js + install: false + start: | + docker compose -f ci.yml --profile prod up + wait-on: "npx wait-on --httpTimeout 20000 http-get://localhost:55001/plone http://localhost:3000" + + # Upload Cypress screenshots + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-screenshots-acceptance + path: acceptance/cypress/screenshots + + # Upload Cypress videos + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-videos-acceptance + path: acceptance/cypress/videos diff --git a/.github/workflows/changelog.yml.txt b/.github/workflows/changelog.yml.txt new file mode 100644 index 00000000..62a9593a --- /dev/null +++ b/.github/workflows/changelog.yml.txt @@ -0,0 +1,43 @@ +name: Changelog check +on: + pull_request: + types: [assigned, opened, synchronize, reopened, labeled, unlabeled] + branches: + - main + +env: + node-version: 16.x + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + # Fetch all history + fetch-depth: '0' + + - name: Install pipx + run: pip install towncrier + + # node setup + - name: Use Node.js ${{ env.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.node-version }} + cache: 'yarn' + + # node install + - name: Install dependencies + run: yarn + + - name: Check for presence of a Change Log fragment (only pull requests) + run: | + # Fetch the pull request' base branch so towncrier will be able to + # compare the current branch with the base branch. + # Source: https://github.com/actions/checkout/#fetch-all-branches. + git fetch --no-tags origin main + towncrier check --compare-with origin/main + env: + BASE_BRANCH: ${{ github.base_ref }} + if: github.event_name == 'pull_request' diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml new file mode 100644 index 00000000..7b573dea --- /dev/null +++ b/.github/workflows/code.yml @@ -0,0 +1,16 @@ +name: Code analysis checks +on: [push] +jobs: + codeanalysis: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] + python-version: [3.8] + + steps: + - name: Main checkout + uses: actions/checkout@v3 + + - name: Linting + run: make lint diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml new file mode 100644 index 00000000..3242e47b --- /dev/null +++ b/.github/workflows/unit.yml @@ -0,0 +1,16 @@ +name: Unit Tests +on: [push] +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] + python-version: [3.8] + + steps: + - name: Main checkout + uses: actions/checkout@v3 + + - name: Linting + run: make test-ci