mirror of
https://github.com/maputnik/editor.git
synced 2026-01-21 04:40:02 +00:00
Resolves #803 This is an initial commit to allow migrating to typescript bit by bit. It introduces vite. It removes all the webpack configuration (which I have no clue what all the profiling are needed for, and couldn't find anything in the readme). It also changes a single file from javascript to typescript: `urlopen.js` -> `urlopen.ts` Which was done manually, later on I'll see if I can automate most of the migration. For now, everything seems to work as expected. I also upgrades storybook to use vite and renames the stories to jsx (I honestly don't know why this complexity is needed here, but I'll keep it for now). cc: @damianstasik
141 lines
3.4 KiB
YAML
141 lines
3.4 KiB
YAML
name: ci
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [ main ]
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build-docker:
|
|
name: build/docker
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: docker build -t docker.pkg.github.com/maputnik/editor/editor:main .
|
|
|
|
# build the editor
|
|
build-node:
|
|
name: "build/node@${{ matrix.node-version }} (${{ matrix.os }})"
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
node-version: [18.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- uses: actions/cache@v1
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
- run: npm ci
|
|
- run: npm run build
|
|
|
|
|
|
build-artifacts:
|
|
name: "build/artifacts (${{ matrix.os }})"
|
|
runs-on: ${{ matrix.os }}
|
|
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
node-version: [18.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- uses: actions/cache@v1
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
- run: npm ci
|
|
- run: npm run build
|
|
- run: npm run build-storybook
|
|
- name: artifacts/editor
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: editor
|
|
path: dist
|
|
- name: artifacts/storybook
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: storybook
|
|
path: build/storybook
|
|
|
|
# Build and upload desktop CLI artifacts
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ^1.19.x
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: maputnik/desktop
|
|
ref: master
|
|
path: ./src/github.com/maputnik/desktop/
|
|
|
|
- name: Make
|
|
run: cd src/github.com/maputnik/desktop/ && make
|
|
|
|
- name: Artifacts/linux
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: maputnik-linux
|
|
path: ./src/github.com/maputnik/desktop/bin/linux/
|
|
|
|
- name: Artifacts/darwin
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: maputnik-darwin
|
|
path: ./src/github.com/maputnik/desktop/bin/darwin/
|
|
|
|
- name: Artifacts/windows
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: maputnik-windows
|
|
path: ./src/github.com/maputnik/desktop/bin/windows/
|
|
|
|
cypress-run:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
browser: [chrome, firefox]
|
|
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- run: npm ci
|
|
- name: Cypress run
|
|
uses: cypress-io/github-action@v6
|
|
with:
|
|
build: npm run build
|
|
start: npm run start
|
|
browser: ${{ matrix.browser }}
|