forked from jitterbit/get-changed-files
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (80 loc) · 3.19 KB
/
ci.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
name: CI
permissions:
contents: write
on:
pull_request:
push:
branches:
- main
jobs:
validate:
name: Test and Validate Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: yarn
- name: Run tests
run: yarn test
- name: Clean, build, format, lint, and package
run: yarn all
- name: Check if packaged properly
run: |
# If there are any unstaged or untracked files in 'dist/', then the action wasn't packaged properly
if git diff --name-only | grep '^dist/' || git ls-files --other --exclude-standard | grep '^dist/'; then
echo "You didn't package the action properly before pushing to remote." \
echo "Always run 'yarn all' before staging a commit."
echo "Below are the modified files in 'dist/' after running 'yarn && rm -rf dist/ && yarn all':"
git diff --name-only | grep '^dist/'
git ls-files --other --exclude-standard | grep '^dist/'
exit 1
fi
integration-test:
name: Run Action
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- id: defaults
name: Run with defaults
uses: ./
- name: Output default
run: |
echo 'steps.defaults.outputs.all=${{ steps.defaults.outputs.all }}'
echo 'steps.defaults.outputs.added=${{ steps.defaults.outputs.added }}'
echo 'steps.defaults.outputs.modified=${{ steps.defaults.outputs.modified }}'
echo 'steps.defaults.outputs.removed=${{ steps.defaults.outputs.removed }}'
echo 'steps.defaults.outputs.renamed=${{ steps.defaults.outputs.renamed }}'
echo 'steps.defaults.outputs.added_modified=${{ steps.defaults.outputs.added_modified }}'
- id: csv
name: Run with csv format
uses: ./
with:
format: csv
- name: Output csv
run: |
echo 'steps.csv.outputs.all=${{ steps.csv.outputs.all }}'
echo 'steps.csv.outputs.added=${{ steps.csv.outputs.added }}'
echo 'steps.csv.outputs.modified=${{ steps.csv.outputs.modified }}'
echo 'steps.csv.outputs.removed=${{ steps.csv.outputs.removed }}'
echo 'steps.csv.outputs.renamed=${{ steps.csv.outputs.renamed }}'
echo 'steps.csv.outputs.added_modified=${{ steps.csv.outputs.added_modified }}'
- id: filter
name: Run with filter
uses: ./
with:
path-filters: |
/.github/
__tests__/**
- name: Output filter
run: |
echo 'steps.filter.outputs.all=${{ steps.filter.outputs.all }}'
echo 'steps.filter.outputs.added=${{ steps.filter.outputs.added }}'
echo 'steps.filter.outputs.modified=${{ steps.filter.outputs.modified }}'
echo 'steps.filter.outputs.removed=${{ steps.filter.outputs.removed }}'
echo 'steps.filter.outputs.renamed=${{ steps.filter.outputs.renamed }}'
echo 'steps.filter.outputs.added_modified=${{ steps.filter.outputs.added_modified }}'