Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add CI with Github Actions #928

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .bundlemonrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"baseDir": "./build",
"files": [
{
"path": "app/store.<hash>.js"
},
{
"path": "app-store.<hash>.min.css"
},
{
"path": "vendors-store.<hash>.min.css"
},
{
"path": "intent-store.<hash>.min.css"
},
{
"path": "intent/store.<hash>.js"
},
{
"path": "services/installSuggestion/store.js"
},
{
"path": "vendors/store.<hash>.js"
}
],
"reportOutput": ["github"]
}
45 changes: 45 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI/CD

on:
pull_request:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'

env:
MATTERMOST_CHANNEL: '{"dev":"app-store","beta":"app-store,publication","stable":"app-store,publication"}'
MATTERMOST_HOOK_URL: ${{ secrets.MATTERMOST_HOOK_URL }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
BUNDLEMON_PROJECT_ID: ${{ secrets.BUNDLEMON_PROJECT_ID }}

jobs:
build:
name: Build and publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Test
run: yarn test
- name: Build
run: yarn build
- name: BundleMon
uses: lironer/bundlemon-action@v1
- name: Set SSH for downcloud
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DOWNCLOUD_SSH_KEY }}
- name: Publish
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
run: yarn run cozyPublish --yes
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"build": "cozy-scripts build --barV7 false",
"watch": "cozy-scripts watch --barV7 false",
"start": "cozy-scripts start --barV7 false",
"cozyPublish": "npx cozy-app-publish --token $REGISTRY_TOKEN --prepublish downcloud --postpublish mattermost",
"cozyPublish": "cozy-app-publish --token $REGISTRY_TOKEN --prepublish downcloud --postpublish mattermost",
"test": "cs test --verbose --coverage",
"stack:docker": "docker run --rm -it -p 8080:8080 -v \"$(pwd)/build\":/data/cozy-app/app cozy/cozy-app-dev"
},
Expand All @@ -34,6 +34,7 @@
"@typescript-eslint/eslint-plugin": "5.54.0",
"@typescript-eslint/parser": "5.54.0",
"babel-preset-cozy-app": "^2.1.0",
"bundlemon": "1.4.0",
"cozy-scripts": "^8.3.0",
"cozy-tsconfig": "^1.2.0",
"enzyme": "3.3.0",
Expand All @@ -60,7 +61,6 @@
"@cozy/minilog": "^1.0.0",
"@sentry/integrations": "^7.114.0",
"@sentry/react": "^8.5.0",
"cozy-app-publish": "^0.27.2",
"cozy-bar": "^15.0.0",
"cozy-client": "^49.4.0",
"cozy-device-helper": "^2.1.0",
Expand Down
23 changes: 23 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4618,6 +4618,29 @@ bundlemon-utils@^0.4.0:
dependencies:
bytes "^3.1.0"

bundlemon-utils@^1.0.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/bundlemon-utils/-/bundlemon-utils-1.2.1.tgz#5585df0072c04c572a52abe0dc794578f96813ff"
integrity sha512-ydFZrI68L5j6hB9y88XGlbOp2lEwZHsDZl31ljHoi+wKE32glbuXMU0d0vQJLiR7Eq6uS0nDNYSmeoFHiV9R2g==
dependencies:
bytes "^3.1.0"

bundlemon@1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/bundlemon/-/bundlemon-1.4.0.tgz#5593e00cd913e638f69a489d4d97a9abecdac85d"
integrity sha512-A5mzeMZrnUzKNNo8ng1PFlxZr57XM2HDsaX07kJ1u59BDWn2JFYNeUIUSXhmLdoqBHK9Ln7wTLXDnoqOlcJP5A==
dependencies:
axios "^0.21.1"
brotli-size "^4.0.0"
bundlemon-utils "^1.0.0"
bytes "^3.1.0"
chalk "^4.1.1"
commander "^8.0.0"
cosmiconfig "^7.0.0"
gzip-size "^6.0.0"
micromatch "^4.0.4"
yup "^0.32.11"

bundlemon@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/bundlemon/-/bundlemon-1.3.2.tgz#164a038b1f4e8f520119367d3ba3b11a2372d19d"
Expand Down
Loading