generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (84 loc) · 2.51 KB
/
test.yaml
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
name: 'build-test'
on:
pull_request_target:
push:
branches:
- main
- 'releases/*'
paths:
- src/**
- __test__/**
- package*
- .github/workflows/test.yaml
workflow_dispatch:
permissions:
contents: read
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set Node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: 16.x
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Fetch ENV from .env.ci
run: |-
cat .env.ci >> $GITHUB_ENV
- name: Run all NPM targets
run: npm run all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
retention-days: 15
name: new-dist
path: dist
test:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Download Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: new-dist
- name: Set environment variables
run: echo "DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Execute test run
uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
pr_title: Test PR
pr_source: test/pr
pr_body: ${{ env.DATE }}
test-extended:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Download Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: new-dist
- name: Set environment variables
run: echo "DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Execute test run with body links
uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
pr_title: Test staging to main
pr_source: test/staging
pr_target: test/main
pr_body: "The following changes are going to be merged from staging to main (${{ env.DATE }}):"
pr_body_with_links: true