Repository navigation
77 lines (71 loc) · 2.31 KB
/
Copy pathtest-workflows.yml
File metadata and controls
77 lines (71 loc) · 2.31 KB
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
name: Test workflows
on:
push:
branches:
- "main"
paths:
- ".github/workflows/**"
pull_request:
branches:
- "main"
paths:
- ".github/workflows/**"
permissions:
contents: read
jobs:
resolve-inputs:
runs-on: ubuntu-latest
if: >-
${{ github.repository_owner == 'Lepinoid'
&& (github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name == github.repository) }}
env:
TEST_REPO: Lepinoid/LepinoidTools
# renovate: datasource=git-refs depName=Lepinoid/LepinoidTools currentValue=main
TEST_REF: 150f366a0e52635810ca3eb15a4d0448563d4921
outputs:
test_repo: ${{ steps.set.outputs.test_repo }}
test_ref: ${{ steps.set.outputs.test_ref }}
steps:
- id: set
run: |
echo "test_repo=${TEST_REPO}" >> "$GITHUB_OUTPUT"
echo "test_ref=${TEST_REF}" >> "$GITHUB_OUTPUT"
test-build:
needs: resolve-inputs
# Reusable workflows cannot elevate permissions beyond the caller job, so pin contracts explicitly.
permissions:
contents: read
uses: ./.github/workflows/build.yml
with:
test_repo: ${{ needs.resolve-inputs.outputs.test_repo }}
test_ref: ${{ needs.resolve-inputs.outputs.test_ref }}
gradle_args: check reobfJar
upload_artifacts: false
secrets:
checkout_token: ${{ secrets.LEPINOID_TOOLS_READ_TOKEN }}
test-ktlint:
needs: resolve-inputs
# reviewdog (github-pr-review / github-check) needs checks:write and pull-requests:write,
# and a called reusable workflow cannot get stronger perms than its caller job.
permissions:
contents: read
checks: write
pull-requests: write
uses: ./.github/workflows/ktlint.yml
with:
test_repo: ${{ needs.resolve-inputs.outputs.test_repo }}
test_ref: ${{ needs.resolve-inputs.outputs.test_ref }}
secrets:
checkout_token: ${{ secrets.LEPINOID_TOOLS_READ_TOKEN }}
test-publish-dry-run:
needs: resolve-inputs
permissions:
contents: read
uses: ./.github/workflows/publish_to_maven-repo.yml
with:
test_repo: ${{ needs.resolve-inputs.outputs.test_repo }}
test_ref: ${{ needs.resolve-inputs.outputs.test_ref }}
dry_run: true
secrets:
checkout_token: ${{ secrets.LEPINOID_TOOLS_READ_TOKEN }}