-
Notifications
You must be signed in to change notification settings - Fork 4
82 lines (80 loc) · 2.33 KB
/
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
name: CI/CD Process
on:
push:
branches-ignore:
- 'renovate/**'
pull_request:
workflow_dispatch:
jobs:
test:
strategy:
matrix:
os: [ windows-2022, macos-12, ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.workflow }}-build-${{ matrix.os }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v3.5.2
with:
path: 'action'
- name: Trick Renovate
id: trick
shell: bash
run: |
# Idea: the regex matcher of Renovate keeps this string up to date automatically
# The version is extracted and used to access the correct version of the scripts
USES=$(cat <<TRICK_RENOVATE
- uses: DanySK/Template-for-Gradle-Plugins@55bbc2e0645170ae47b9ff98b7545acf505e2998
TRICK_RENOVATE
)
echo "Scripts update line: \"$USES\""
echo "Computed version: \"${USES#*@}\""
echo "::set-output name=version::${USES#*@}"
- name: Checkout test repo
uses: actions/checkout@v3.5.2
with:
repository: DanySK/Template-for-Gradle-Plugins
path: 'target'
ref: ${{ steps.trick.outputs.version }}
- uses: ./action
with:
build-command: ./gradlew tasks
check-command: true
working-directory: target
should-run-codecov: false
clean-command: ./gradlew clean
- uses: ./action
with:
working-directory: target
should-run-codecov: false
release:
if: github.event_name == 'push'
needs:
- test
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3.5.2
with:
token: ${{ secrets.DEPLOYMENT_TOKEN }}
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install
npx semantic-release
success:
runs-on: ubuntu-22.04
needs:
- test
- release
if: >-
always() && (
contains(join(needs.*.result, ','), 'failure')
|| !contains(join(needs.*.result, ','), 'cancelled')
)
steps:
- name: Verify that there were no failures
run: ${{ !contains(join(needs.*.result, ','), 'failure') }}