summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael <mail@raphaelkabo.com>2023-10-06 15:19:11 +0100
committerGitHub <noreply@github.com>2023-10-06 15:19:11 +0100
commitf390b1d45b3f44a860fef4df2b31064f441b5065 (patch)
treef2168a018122784bf3ab138703bf39375bec871c
parentaad4162be83486553b08dacf556814f4108a2a81 (diff)
parent4871e826eaca2bd8869775e8c548151c038a3254 (diff)
Merge pull request #110 from lowercasename/rk/cypress-workflow
Cypress workflow
-rw-r--r--.github/workflows/build-test.yaml54
-rw-r--r--.github/workflows/ci.yaml67
-rwxr-xr-x.gitignore3
3 files changed, 70 insertions, 54 deletions
diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml
deleted file mode 100644
index 5c38dfb..0000000
--- a/.github/workflows/build-test.yaml
+++ /dev/null
@@ -1,54 +0,0 @@
-name: Build and test
-on:
- pull_request:
- workflow_dispatch:
- push:
- branches:
- - main
-
-jobs:
- build_and_test:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- - uses: pnpm/action-setup@v2
- with:
- version: 8
- - uses: actions/setup-node@v3
- with:
- node-version-file: ".nvmrc"
- cache: "pnpm"
- cache-dependency-path: "pnpm-lock.yaml"
- - name: Install dependencies
- run: pnpm install
- - name: Set up config files
- run: cp config/config.example.toml config/config.toml
- - name: Build
- run: pnpm build
- continue-on-error: true
- - name: Start and test
- run: |
- pnpm start &
- sleep 5
- curl -sSf http://localhost:3000
- - name: Upload artefacts
- uses: actions/upload-artifact@v3
- with:
- name: build
- path: |
- dist
- node_modules
- cypress:
- needs: build_and_test
- runs-on: ubuntu-latest
- steps:
- - name: Download artefacts
- uses: actions/download-artifact@v3
- with:
- name: build
- - name: Cypress run
- uses: cypress-io/github-action@v6
- with:
- start: pnpm start
- browser: chrome
-
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 0000000..1e0be7a
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,67 @@
+name: CI / Build and test
+on:
+ pull_request:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+
+jobs:
+ install:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: 8
+
+ - name: Set up config files
+ run: cp config/config.example.toml config/config.toml
+
+ - name: Cypress install
+ uses: cypress-io/github-action@v6
+ with:
+ # Disable running of tests within install job
+ runTests: false
+ build: pnpm run build
+ continue-on-error: true
+
+ - name: Save build folder
+ uses: actions/upload-artifact@v3
+ with:
+ name: dist
+ if-no-files-found: error
+ path: dist
+
+ cypress-run:
+ runs-on: ubuntu-latest
+ needs: install
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: 8
+
+ - name: Set up config files
+ run: cp config/config.example.toml config/config.toml
+
+ - name: Download the build folder
+ uses: actions/download-artifact@v3
+ with:
+ name: dist
+ path: dist
+
+ - name: Start MongoDB
+ uses: supercharge/mongodb-github-action@1.10.0
+
+ - name: Cypress run
+ uses: cypress-io/github-action@v6
+ with:
+ start: pnpm start
+ browser: chrome \ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 683b41a..e68efaa 100755
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,9 @@ dist
public/events/*
!public/events/.gitkeep
+# CI files
+dist.zip
+
# Logs
logs
*.log