Skip to content

Commit

Permalink
Merge pull request #786 from thomasnordquist/tnordquist/test-ci
Browse files Browse the repository at this point in the history
chore: add ci / cd piplelines as github actions
  • Loading branch information
thomasnordquist authored May 11, 2024
2 parents a6e16dc + 7fb0483 commit 898fd38
Show file tree
Hide file tree
Showing 14 changed files with 3,386 additions and 862 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package.ts @thomasnordquist
.github @thomasnordquist
scripts @thomasnordquist
29 changes: 29 additions & 0 deletions .github/workflows/build-dockerfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
push:
branches:
- master
- release
- beta
paths:
- Dockerfile
- .github

jobs:
create-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/thomasnordquist/mqtt-explorer-ui-tests:latest
42 changes: 42 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
push:
branches:
- release
- beta

concurrency:
group: ${{ github.ref }}
cancel-in-progress: false

jobs:
platform_matrix:
strategy:
matrix:
build:
- os: ubuntu-latest
task: linux
- os: windows-latest
task: win
# - os: macos-latest
# task: mac
runs-on: ${{ matrix.build.os }}
steps:
- if: matrix.build.os == 'ubuntu-latest'
run: sudo snap install snapcraft --classic
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g yarn
- run: yarn
- run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn build
- run: yarn prepare-release
# - run: yarn package ${{ matrix.build.task }}
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
pull_request_target: # Use pull_request_target
branches: [master, beta, release]

jobs:
test:
runs-on: ubuntu-latest
container:
image: ghcr.io/thomasnordquist/mqtt-explorer-ui-tests:latest
volumes:
- ./:/app
options: --user root
steps:
- uses: actions/checkout@v4
- name: Install Packages
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Test
run: yarn test
- name: UI-Test
run: yarn ui-test
- name: Post-processing
run: ./scripts/prepareVideo.sh
- uses: hkusu/s3-upload-action@v2
id: upload # specify some ID for use in subsequent steps
with:
aws-access-key-id: ${{ vars.AWS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: 'eu-central-1'
aws-bucket: ${{ vars.AWS_BUCKET }}
file-path: './ui-test.gif'
content-type: image/gif
output-file-url: 'true'
- name: Show URL
run: echo '${{ steps.upload.outputs.file-url }}'
id: artifact-upload-step
- run: echo '![test](${{ steps.upload.outputs.file-url }})' >> $GITHUB_STEP_SUMMARY
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

29 changes: 29 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"branches": [
"release",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"semantic-release-export-data",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"yarn.lock"
]
}
]
]
}
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions docker/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:19.8.1-bullseye-slim
FROM node:20

RUN DEBIAN_FRONTEND="noninteractive" apt-get update \
&& apt-get install -y --no-install-recommends nano ffmpeg xvfb git-core tmux locales mosquitto x11vnc
&& apt-get install -y --no-install-recommends ca-certificates nano ffmpeg xvfb git-core tmux locales mosquitto x11vnc
RUN apt-get install -yq --no-install-recommends libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libnss3

# Generate locales for TMUX
Expand All @@ -12,6 +12,5 @@ ENV LC_ALL en_US.UTF-8

CMD /bin/bash

COPY cloneBuildAndTest.sh ./
VOLUME /app
EXPOSE 5900
17 changes: 14 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
[![Build status](https://ci.appveyor.com/api/projects/status/c35tkm29rm4m5364/branch/master?svg=true)](https://ci.appveyor.com/project/thomasnordquist/mqtt-explorer/branch/master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/47b26e03fce543ceac7914214482334a)](https://app.codacy.com/app/thomasnordquist/MQTT-Explorer?utm_source=github.com&utm_medium=referral&utm_content=thomasnordquist/MQTT-Explorer&utm_campaign=Badge_Grade_Dashboard)

| | | |
|:---:|:---:|:---:|
|[![screen_composite](https://mqtt-explorer.com/img/screen-composite_small.png)](https://mqtt-explorer.com/img/screen-composite.png)|[![screen2_small](https://mqtt-explorer.com/img/screen2_small.png)](https://mqtt-explorer.com/img/screen2.png)|[![screen3_small](https://mqtt-explorer.com/img/screen3_small.png)](https://mqtt-explorer.com/img/screen3.png)|
| | | |
| :---------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: |
| [![screen_composite](https://mqtt-explorer.com/img/screen-composite_small.png)](https://mqtt-explorer.com/img/screen-composite.png) | [![screen2_small](https://mqtt-explorer.com/img/screen2_small.png)](https://mqtt-explorer.com/img/screen2.png) | [![screen3_small](https://mqtt-explorer.com/img/screen3_small.png)](https://mqtt-explorer.com/img/screen3.png) |

# The App has moved to [mqtt-explorer.com](https://mqtt-explorer.com)

MQTT Explorer is a comprehensive and easy-to-use MQTT Client.
Downloads can be found at the link above.

Expand All @@ -29,6 +30,7 @@ yarn start
## Develop

Launch Application

```bash
npm install -g yarn
yarn
Expand Down Expand Up @@ -63,6 +65,15 @@ npm run build
node dist/src/spec/webdriverio.js
```

## Create a release

Create a PR to `release` branch.
There needs to be a "feat: some new feature" or "fix: some bugfix" commit for a new release to be created

## Create a beta release

Create a PR to `beta` branch. A "feat" or "fix" commit is necessary to create a new version.

## Write docs

```
Expand Down
4 changes: 0 additions & 4 deletions docker/cloneBuildAndTest.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/bash
set -e

git clone https://github.com/thomasnordquist/MQTT-Explorer.git /app
cd /app
git checkout travis-ui-tests

yarn install --frozen-lockfile
yarn build

Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "MQTT-Explorer",
"version": "0.4.0-beta4",
"version": "0.4.0-beta.2",
"description": "Explore your message queues",
"main": "dist/src/electron.js",
"engines": {
"node": ">=18"
},
"private": "true",
"scripts": {
"start": "electron .",
"test": "yarn test:app && yarn test:backend",
Expand Down Expand Up @@ -78,6 +79,9 @@
"@babel/runtime": "^7.17.2",
"@cspell/dict-typescript": "^3.1.2",
"@electron/notarize": "^2.3.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^12.0.0",
"@semantic-release/git": "^10.0.1",
"@types/chai": "^4.1.7",
"@types/fs-extra": "8",
"@types/lowdb": "^1.0.6",
Expand All @@ -100,6 +104,8 @@
"playwright": "^1.43.0",
"prettier": "^3.2.5",
"redux-thunk": "^2.3.0",
"semantic-release": "^23.0.8",
"semantic-release-export-data": "^1.0.1",
"source-map-support": "^0.5.9",
"ts-node": "^10.9.2",
"tslint": "^6.1.3",
Expand All @@ -125,4 +131,4 @@
"uuid": "^8.3.2",
"yarn-run-all": "^3.1.1"
}
}
}
6 changes: 3 additions & 3 deletions package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as dotProp from 'dot-prop'

const linuxAppImage: builder.CliOptions = {
x64: true,
ia32: true,
ia32: false,
armv7l: true,
arm64: false,
projectDir: './build/clean',
Expand Down Expand Up @@ -50,9 +50,9 @@ const winAppx: builder.CliOptions = {

const mac: builder.CliOptions = {
x64: true,
ia32: true,
ia32: false,
armv7l: false,
arm64: false,
arm64: true,
projectDir: './build/clean',
publish: 'always',
}
Expand Down
3 changes: 0 additions & 3 deletions scripts/uiTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,4 @@ tmux send-keys -t record q
# Ensure video is written
sleep 5

# Process the video
./scripts/prepareVideo.sh

exit $TEST_EXIT_CODE
Loading

0 comments on commit 898fd38

Please sign in to comment.