Skip to content

Commit

Permalink
Update setup. Use new images. (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Jun 4, 2024
1 parent 65d232a commit 9046204
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 125 deletions.
43 changes: 17 additions & 26 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Acceptance tests
on: [push, pull_request]

env:
node-version: 20.x
NODE_VERSION: 20.x
CYPRESS_RETRIES: 2

jobs:

Expand All @@ -12,18 +13,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ env.node-version }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
node-version: ${{ env.NODE_VERSION }}

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
# We don't want to install until later,
# when the cache and Cypress are in place
run_install: false
- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
Expand All @@ -43,7 +39,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: binary-${{ env.node-version }}-${{ hashFiles('pnpm-lock.yaml') }}
key: binary-${{ env.NODE_VERSION }}-${{ hashFiles('pnpm-lock.yaml') }}

- name: Install dependencies
run: make install
Expand All @@ -57,8 +53,8 @@ jobs:
name: Start Servers
with:
run: |
make start-test-acceptance-server-ci &
make start-test-acceptance-frontend &
make ci-acceptance-backend-start &
make acceptance-frontend-prod-start &
# your step-level and job-level environment variables are available to your commands as-is
# npm install will count towards the wait-for timeout
# whenever possible, move unrelated scripts to a different step
Expand All @@ -85,7 +81,7 @@ jobs:

# working-directory: backend

- run: make test-acceptance-headless
- run: make ci-acceptance-test

# Upload Cypress screenshots
- uses: actions/upload-artifact@v3
Expand All @@ -107,18 +103,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Use Node.js 20.x
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: ${{ env.NODE_VERSION }}

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
# We don't want to install until later,
# when the cache and Cypress are in place
run_install: false
- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
Expand Down Expand Up @@ -152,8 +143,8 @@ jobs:
name: Start Servers
with:
run: |
make start-test-acceptance-server-a11y-ci &
make start-test-acceptance-frontend-a11y &
make ci-acceptance-a11y-backend-start &
make acceptance-a11y-frontend-prod-start &
# your step-level and job-level environment variables are available to your commands as-is
# npm install will count towards the wait-for timeout
# whenever possible, move unrelated scripts to a different step
Expand All @@ -180,7 +171,7 @@ jobs:

# working-directory: backend

- run: make test-acceptance-headless-a11y
- run: make ci-acceptance-a11y-test

# Upload Cypress screenshots
- uses: actions/upload-artifact@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

env:
node-version: 20.x
NODE_VERSION: 20.x
ADDON_NAME: volto-light-theme

jobs:
Expand All @@ -21,10 +21,10 @@ jobs:
- name: Install pipx
run: pip install towncrier

- name: Use Node.js ${{ env.node-version }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
node-version: ${{ env.NODE_VERSION }}

- uses: pnpm/action-setup@v3
name: Install pnpm
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Code analysis checks
on: [push]

env:
node-version: 20.x
NODE_VERSION: 20.x

jobs:
codeanalysis:
Expand All @@ -12,18 +12,13 @@ jobs:
- name: Main checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ env.node-version }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
node-version: ${{ env.NODE_VERSION }}

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
# We don't want to install until later,
# when the cache and Cypress are in place
run_install: false
- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
ENVIRONMENT=${{ env.ENVIRONMENT }}
echo "ENVIRONMENT=${ENVIRONMENT}" >> $GITHUB_OUTPUT
echo "STACK_NAME=${ENVIRONMENT//./-}" >> $GITHUB_OUTPUT
python3 -c 'import json; data = json.load(open("mrs.developer.json")); print("VOLTO_VERSION=" + data["core"]["tag"] or 'latest')' >> $GITHUB_OUTPUT
python3 -c 'import json; data = json.load(open("./mrs.developer.json")); print("VOLTO_VERSION=" + data["core"].get("tag") or "latest")' >> $GITHUB_OUTPUT
- run: echo "${{ steps.vars.outputs.VOLTO_VERSION }}"

Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
with:
platforms: linux/amd64
context: ./
file: dockerfiles/Dockerfile
file: Dockerfile
build-args: |
ADDON_NAME=@kitconcept/volto-light-theme
ADDON_PATH=volto-light-theme
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: i18n
on: [push]

env:
node-version: 20.x
NODE_VERSION: 20.x

jobs:
unit:
Expand All @@ -12,18 +12,13 @@ jobs:
- name: Main checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ env.node-version }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
node-version: ${{ env.NODE_VERSION }}

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
# We don't want to install until later,
# when the cache and Cypress are in place
run_install: false
- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Unit Tests
on: [push]

env:
node-version: 20.x
NODE_VERSION: 20.x

jobs:
unit:
Expand All @@ -12,18 +12,13 @@ jobs:
- name: Main checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ env.node-version }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
node-version: ${{ env.NODE_VERSION }}

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
# We don't want to install until later,
# when the cache and Cypress are in place
run_install: false
- name: Enable corepack
run: corepack enable

- name: Get pnpm store directory
shell: bash
Expand Down
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# syntax=docker/dockerfile:1
ARG VOLTO_VERSION
# TODO: Replace with
# FROM plone/frontend-builder:${VOLTO_VERSION}
# when the main image is ready
FROM ghcr.io/kitconcept/frontend-builder:${VOLTO_VERSION} as builder

COPY --chown=node packages/volto-light-theme /app/packages/volto-light-theme
COPY --chown=node volto.config.js /app/
COPY --chown=node package.json /app/package.json.temp

RUN --mount=type=cache,id=pnpm,target=/app/.pnpm-store,uid=1000 <<EOT
python3 -c "import json; data = json.load(open('package.json.temp')); deps = data['dependencies']; data['dependencies'].update(deps); json.dump(data, open('package.json', 'w'), indent=2)"
rm package.json.temp
pnpm install
pnpm build
pnpm install --prod
EOT

# TODO: Replace with
# FROM plone/frontend-prod-config:${VOLTO_VERSION}
# when the main image is ready
FROM ghcr.io/kitconcept/frontend-prod-config:${VOLTO_VERSION}

LABEL maintainer="Plone Foundation <[email protected]>" \
org.label-schema.name="adfsdf-frontend" \
org.label-schema.description="adfsdf frontend image." \
org.label-schema.vendor="Plone Foundation"

COPY --from=builder /app/ /app/
Loading

0 comments on commit 9046204

Please sign in to comment.