-
-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (92 loc) · 2.63 KB
/
build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: "Build tests"
on:
pull_request:
paths-ignore:
- "**.md"
- "**.yml"
push:
branches:
- main
paths-ignore:
- "**.md"
workflow_dispatch:
permissions:
contents: read
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Detect Node version
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvmrc
- name: Use Node.js ${{ steps.nvmrc.outputs.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: "${{ steps.nvmrc.outputs.NODE_VERSION }}"
- name: Install dependencies
run: |
npm install
- name: Lint, test, build
run: |
npm run all
- name: Save Action Artifact
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: release-artifact
path: |
./dist
action.yml
package.json
!dist/utils
basic:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Action Artifact
uses: actions/download-artifact@v3
with:
name: release-artifact
path: ./
- name: Display structure of downloaded files
run: ls -R
- name: Simple release for output
uses: ./
id: release-notification
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
full:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Action Artifact
uses: actions/download-artifact@v3
with:
name: release-artifact
path: ./
- name: Release to Slack
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_webhook_urls: ${{ secrets.SLACK_WEBHOOK_URL }}
sentry_project_name: ${{ secrets.SENTRY_PROJECT_NAME }}
sentry_project_id: ${{ secrets.SENTRY_PROJECT_ID }}
grafana_dashboard_link: https://example.grafana.net/d/xxxx/web-overview?orgId=1
jira_ticket_prefix: "ABC"
jira_instance_url: "https://example.atlassian.net"
time_zone_offset: "-4" # Toronto (Canada - Ontario)