Skip to content

Commit

Permalink
chore: deploy from ci and improve performance (#9)
Browse files Browse the repository at this point in the history
* chore: improve actions performance with yarn cache

* chore: remove duplicate tests for pull requests

* chore: rename test build name

* chore: add deployment from ci
  • Loading branch information
byCedric authored Aug 17, 2020
1 parent 1a0b68b commit 1ee6c70
Show file tree
Hide file tree
Showing 5 changed files with 276 additions and 28 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,30 @@ on:
branches:
- master
jobs:
test:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Setup repository
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn install --frozen-lockfile --check-files
- run: yarn build:production
- name: Find Yarn cache
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
- name: Build project
run: yarn build:production
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Publish
on:
release:
types: [published]
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Setup repository
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Find Yarn cache
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
- name: Build project
run: yarn build:production
- name: Publish version
run: yarn deploy
env:
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
33 changes: 22 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
---
name: Test
on:
pull_request:
push:
branches-ignore:
- master
on: [pull_request]
jobs:
test:
name: Test
name: Build and lint
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Setup repository
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn install --frozen-lockfile --check-files
- run: yarn build
- run: yarn lint
- name: Find Yarn cache
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
- name: Build project
run: yarn build
- name: Lint project
run: yarn lint
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"clean": "git clean -xdf out *tsbuildinfo",
"pretest": "yarn build && yarn lint",
"test": "node ./out/test/runTest.js",
"lint": "eslint src --ext ts"
"lint": "eslint src --ext ts",
"deploy": "vsce publish --yarn"
},
"dependencies": {
"@expo/xdl": "^57.9.1"
Expand All @@ -64,6 +65,7 @@
"mocha": "^7.1.2",
"shebang-loader": "^0.0.1",
"typescript": "^3.8.3",
"vsce": "^1.78.0",
"vscode-test": "^1.3.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
Expand Down
Loading

0 comments on commit 1ee6c70

Please sign in to comment.