-
Notifications
You must be signed in to change notification settings - Fork 4
104 lines (92 loc) · 4.23 KB
/
pipeline.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
name: "pipeline"
on:
push:
branches: ['main']
workflow_dispatch:
inputs:
dry-run:
description: 'dry run mode'
required: true
default: true
type: boolean
jobs:
setup:
runs-on: ubuntu-latest
outputs:
any_changed: ${{ steps.changed-files-yaml.outputs.any_changed }}
all_changed_files: ${{ steps.changed-files-yaml.outputs.all_changed_files }}
staging_area_all_changed_files: ${{ steps.changed-files-yaml.outputs.staging_area_all_changed_files }}
staging_area_any_changed: ${{ steps.changed-files-yaml.outputs.staging_area_any_changed }}
tests_all_changed_files: ${{ steps.changed-files-yaml.outputs.tests_all_changed_files }}
tests_any_changed: ${{ steps.changed-files-yaml.outputs.tests_any_changed }}
api_all_changed_files: ${{ steps.changed-files-yaml.outputs.api_all_changed_files }}
api_any_changed: ${{ steps.changed-files-yaml.outputs.api_any_changed }}
client_all_changed_files: ${{ steps.changed-files-yaml.outputs.client_all_changed_files }}
client_any_changed: ${{ steps.changed-files-yaml.outputs.client_any_changed }}
index_all_changed_files: ${{ steps.changed-files-yaml.outputs.index_all_changed_files }}
index_any_changed: ${{ steps.changed-files-yaml.outputs.index_any_changed }}
is_dry_run: ${{ steps.decide-on-dry-run.outputs.dry_run }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get all relevant file changes
id: changed-files-yaml
uses: tj-actions/changed-files@v42
with:
files_yaml: |
staging_area:
- src/PackageRegistryServive/StagingArea/**
test:
- tests/**
api:
- src/PackageRegistryServive/**
- '!src/PackageRegistryServive/StagingArea/'
client:
- src/AVPRClient/**
index:
- src/AVPRIndex/**
- name: list changes
run: |
echo "global:"
echo "- any: ${{ steps.changed-files-yaml.outputs.any_changed }}"
echo "- all: ${{ steps.changed-files-yaml.outputs.staging_area_all_changed_files }}"
echo "staging area:"
echo "- any: ${{ steps.changed-files-yaml.outputs.staging_area_any_changed }}"
echo "- all: ${{ steps.changed-files-yaml.outputs.staging_area_all_changed_files }}"
echo "tests:"
echo "- any: ${{ steps.changed-files-yaml.outputs.tests_any_changed }}"
echo "- all: ${{ steps.changed-files-yaml.outputs.tests_all_changed_files }}"
echo "api:"
echo "- any: ${{ steps.changed-files-yaml.outputs.api_any_changed }}"
echo "- all: ${{ steps.changed-files-yaml.outputs.api_all_changed_files }}"
echo "client:"
echo "- any: ${{ steps.changed-files-yaml.outputs.client_any_changed }}"
echo "- all: ${{ steps.changed-files-yaml.outputs.client_all_changed_files }}"
echo "index:"
echo "- any: ${{ steps.changed-files-yaml.outputs.index_any_changed }}"
echo "- all: ${{ steps.changed-files-yaml.outputs.index_all_changed_files }}"
echo "dry run: ${{ steps.decide-on-dry-run.outputs.dry_run }}"
- name: decide on dry run
id: decide-on-dry-run
run: |
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
dry_run=${{ inputs.dry-run }}
else
dry_run=false
fi
echo "dry_run=$dry_run" >> "$GITHUB_OUTPUT"
echo "$GITHUB_OUTPUT"
echo "dry_run=$dry_run"
test_env:
runs-on: ubuntu-latest
needs: setup
steps:
- name: list changes
run: |
echo "staging area: ${{ needs.get_changed_files.outputs.changed_files_staging_area }}"
echo "test: ${{ needs.get_changed_files.outputs.changed_files_test }}"
echo "api: ${{ needs.get_changed_files.outputs.changed_files_api }}"
echo "client: ${{ needs.get_changed_files.outputs.changed_files_client }}"
echo "index: ${{ needs.get_changed_files.outputs.changed_files_index }}"
echo "dry run: ${{ needs.get_changed_files.outputs.is_dry_run }}"