Skip to content

Commit

Permalink
Launchpad on Github Actions (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszantas authored Apr 22, 2022
1 parent 1dbe7fd commit 62fd8f8
Show file tree
Hide file tree
Showing 8 changed files with 9,192 additions and 36,446 deletions.
48 changes: 0 additions & 48 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,40 +101,6 @@ commands:
- store_artifacts:
path: integration_tests/temp/reports

launchpad-ci:
description: Run Launchpad-such-wow tests
steps:
- run:
name: node -v
command: node -v
- run:
name: npm -v
command: npm -v
- run:
name: Remove package-lock.json
command: cd applications/launchpad_v2 && rm package-lock.json
- run:
name: npm install
command: cd applications/launchpad_v2 && npm install
- run:
name: lint
command: |
cd applications/launchpad_v2
npm run lint:test
when: always
- run:
name: test
command: |
cd applications/launchpad_v2
npm run test:ci
environment:
JEST_JUNIT_OUTPUT_DIR: applications/launchpad_v2/temp/reports/junit
- store_test_results:
path: applications/launchpad_v2/temp/reports
- store_artifacts:
path: applications/launchpad_v2/temp/reports
destination: launchpad_reports

jobs:
run-integration-tests:
docker:
Expand All @@ -156,15 +122,6 @@ jobs:
- checkout
- cucumber-js-ffi

run-launchpad-tests:
docker:
- image: *rust_image
environment:
CARGO_HTTP_MULTIPLEXING: false
steps:
- checkout
- launchpad-ci

workflows:
version: 2
workflow:
Expand All @@ -181,8 +138,3 @@ workflows:
ignore:
- gh-pages
- /launchpad.*/ # TODO: Remove this filter once the branch is merged into development
- run-launchpad-tests: # TODO: Remove this workflow once the branch is merged into development
filters:
branches:
only:
- /launchpad.*/
65 changes: 65 additions & 0 deletions .github/workflows/launchpad_v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Launchpad v2 CI

on:
push:
branches:
- launchpad_such_wow
pull_request:
branches:
- "launchpad**"
types:
- opened
- reopened
- synchronize

jobs:
launchpad-v2-ci:
name: test launchpad_v2
runs-on: ubuntu-18.04
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: "16"
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-11-20
components: rustfmt
override: true
- name: install Tauri dependencies (ubuntu only)
if: startsWith(runner.os,'Linux')
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
webkit2gtk-4.0 \
libappindicator3-dev \
librsvg2-dev \
patchelf
- name: check environment
run: |
node -v
npm -v
yarn -v
rustc --version
date
- name: install
run: |
cd applications/launchpad_v2
yarn install
- name: yarn lint
run: |
cd applications/launchpad_v2
yarn lint:ci
- name: yarn test
run: |
cd applications/launchpad_v2
yarn test:ci
- name: Upload the test coverage
uses: actions/upload-artifact@v2
with:
name: launchpad_v2_test_results
path: applications/launchpad_v2/temp/reports
20 changes: 20 additions & 0 deletions .github/workflows/launchpad_v2_audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Runs daily
name: Launchpad v2 NPM audit
on:
schedule:
- cron: "0 8 * * *"
jobs:
launchpad_v2_audit:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: check environment
run: |
node -v
npm -v
yarn -v
- name: npm audit launchpad_v2
run: |
cd applications/launchpad_v2
npm audit
21 changes: 12 additions & 9 deletions applications/launchpad_v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ The Tari Launchpad is dedicated for beginners in Blockchain world, as well as fo

**Minimal requirements**

* Rust (`> 1.58`)
* Node (`> 16.*`)
* Docker Engine & Docker Compose installed
- Rust (`> 1.58`)
- Node (`> 16.*`)
- Docker Engine & Docker Compose installed

**Techs**

* Tauri
* React
* Typescript
* Rust
- Tauri
- React
- Typescript
- Rust

**Steps**

Expand Down Expand Up @@ -65,6 +65,7 @@ $ npm run bundle
1. Put types and interface in co-located `types.ts` file

component JSDoc examples:

```js
/**
* renders tari button
Expand Down Expand Up @@ -114,6 +115,8 @@ Recommendations:
- `types` - (?) not sure if we need this. It should contain common types used across the application. we keep it for now and remove at the end if not needed.
- `utils` - helpers etc.

### CI with CircleCI
### CI with GitHub actions

1. For every pull request when branch name starts with `launchpad`. It runs lint and tests. (`.github/workflows/launchpad_v2.yml`)

The CircleCI runs tests and eslint check for branches that name starts with `launchpad`.
1. Daily NPM audit (`.github/workflows/launchpad_v2_audit.yml`)
Loading

0 comments on commit 62fd8f8

Please sign in to comment.