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: fix github actions #143

Merged
merged 1 commit into from
Feb 17, 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
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
on: ["push", "pull_request"]
on: [ "push", "pull_request" ]
name: Test coverage
jobs:
build:
Expand All @@ -7,10 +7,10 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Use Node.js 10.x
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 17
node-version: 18

- run: npm ci
- run: npm run test
Expand Down
37 changes: 28 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,49 @@
name: Release

on: [push]
on:
push:
branches: [ "main" ]
pull_request:
types: [ opened, synchronize ]

jobs:
release:
timeout-minutes: 15
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Prepare repository
run: git fetch --unshallow --tags

- name: Use Node.js 12.x
uses: actions/setup-node@v1
- name: Cache turbo build setup
uses: actions/cache@v3
with:
node-version: 17.x
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- run: npm ci
- run: npm run test
- run: npm run build
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Run tests
run: npm run test

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
MICROSOFT_TEAMS_WEBHOOK_URL: ${{ secrets.MICROSOFT_TEAMS_WEBHOOK_URL }}
run: |
npm run release
npx auto shipit
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"packages/*"
],
"scripts": {
"build": "turbo run build",
"build": "turbo run build --cache-dir=.turbo",
"dev": "turbo run dev --parallel",
"lint": "turbo run lint",
"test": "turbo run test",
Expand All @@ -26,7 +26,6 @@
"@auto-it/released": "^11.0.4",
"auto": "^11.0.4",
"dotenv-cli": "^7.3.0",
"lerna": "^8.1.2",
"prettier": "^3.2.5",
"turbo": "latest"
},
Expand Down
35 changes: 26 additions & 9 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
{
"$schema": "https://turborepo.org/schema.json",
"baseBranch": "origin/main",
"pipeline": {
"dev": {
"dependsOn": ["^build"],
"outputs": [".next/**"]
"dependsOn": [
"^build"
],
"outputs": [
".next/**"
]
},
"build": {
"dependsOn": ["^build"],
"outputs": [".next/**", "lib/**"]
"dependsOn": [
"^build"
],
"outputs": [
".next/**",
"lib/**"
]
},
"test": {
"cache": false,
"dependsOn": ["^build"],
"outputs": ["coverage/**", ".nyc_output/**"]
"dependsOn": [
"^build"
],
"outputs": [
"coverage/**",
".nyc_output/**"
]
},
"test.watch": {
"cache": false
},
"coverage:html": {
"dependsOn": ["^test"],
"outputs": ["coverage/**"]
"dependsOn": [
"^test"
],
"outputs": [
"coverage/**"
]
}
}
}
Loading