-
Notifications
You must be signed in to change notification settings - Fork 14
86 lines (73 loc) · 3.42 KB
/
TestComposerLockDiff.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
name: "Test Composer Lock Diff"
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
Test-Composer-Lock-Diff:
runs-on: ubuntu-24.04
strategy:
matrix:
drupal-version: [ 10, 11 ]
steps:
- name: Create a Drupal project
run: composer create-project drupal/recommended-project:^${{ matrix.drupal-version }} . --ignore-platform-reqs
- uses: actions/checkout@v4
with:
path: drainpipe
- uses: ./drainpipe/scaffold/github/actions/common/set-env
- name: Install DDEV
uses: ./drainpipe/scaffold/github/actions/common/ddev
with:
git-name: Drainpipe Bot
git-email: [email protected]
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Setup Project
run: |
ddev config --auto
ddev start
ddev exec --raw composer config extra.drupal-scaffold.gitignore true
ddev exec --raw composer config --json extra.drupal-scaffold.allowed-packages \[\"lullabot/drainpipe\"]
ddev exec --raw composer config --no-plugins allow-plugins.composer/installers true
ddev exec --raw composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true
ddev exec --raw composer config --no-plugins allow-plugins.lullabot/drainpipe true
ddev exec --raw composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}'
ddev exec --raw composer config minimum-stability dev
ddev composer require lullabot/drainpipe --with-all-dependencies
- name: Commit current state
run: |
echo "/drainpipe" >> .gitignore
git config --global user.email "[email protected]"
git config --global user.name "Drainpipe Bot"
git init
git add .
git commit -m "Initial commit"
- name: Install Composer Lock Diff
run : ddev composer global require davidrjonas/composer-lock-diff:^1.0
- name: Add a new package
run: ddev composer require sebastian/version:4.0.1
- name: Run Composer Lock Diff on a Renovate PR
run: |
ddev task "github:composer-lock-diff pull_request='drainpipe/tests/fixtures/composer-lock-diff/github/renovate.json' json_file='renovate-processed.json'"
if [ "$(cat renovate-processed.json)" != "$(cat drainpipe/tests/fixtures/composer-lock-diff/github/renovate-after.json)" ]; then
echo "Expected description not produced"
exit 1
fi
- name: Run Composer Lock Diff on a PR Template
run: |
ddev task "github:composer-lock-diff pull_request='drainpipe/tests/fixtures/composer-lock-diff/github/pr-template.json' json_file='pr-template-processed.json'"
if [ "$(cat pr-template-processed.json)" != "$(cat drainpipe/tests/fixtures/composer-lock-diff/github/pr-template-after.json)" ]; then
echo "Expected description not produced"
exit 1
fi
- name: Upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: processed-descriptions-${{ matrix.drupal-version }}
path: |
renovate-processed.json
pr-template-processed.json