-
Notifications
You must be signed in to change notification settings - Fork 17
109 lines (105 loc) · 3.04 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Continuous Integration
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
jobs:
scalafmt:
name: Scalafmt and Scalafix
runs-on: ubuntu-latest
defaults:
run:
working-directory: sbt-plugin
steps:
- uses: actions/checkout@v3
- uses: coursier/[email protected]
with:
apps: scalafmt sbt
- run: scalafmt --test
- run: sbt 'scalafixAll -test'
test-sbt:
strategy:
matrix:
include:
- os: ubuntu-latest
jvm: 'adoptium:1.8.0-412'
- os: windows-latest
jvm: 'adoptium:1.11.0.23'
- os: macOS-latest
jvm: 'adoptium:1.17'
fail-fast: false
name: Test sbt plugin on ${{ matrix.os }} - ${{ matrix.jvm }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
defaults:
run:
working-directory: sbt-plugin
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v3
- uses: coursier/[email protected]
with:
jvm: ${{ matrix.jvm }}
apps: sbt
- run: sbt test
- run: sbt "scripted dependency-manifest/* generate-snapshot/*"
- run: sbt "scripted submit-snapshot/*"
if: github.event_name == 'push' || github.event.pull_request.head.repo.owner.login == 'scalacenter'
test-action:
if: github.event_name == 'push' || github.event.pull_request.head.repo.owner.login == 'scalacenter'
strategy:
matrix:
include:
- os: ubuntu-latest
jvm: 'adoptium:1.11.0.23'
- os: macOS-latest
jvm: 'adoptium:1.17'
- os: windows-latest
jvm: 'adoptium:1.8.0-412'
os: [ubuntu-latest, macOS-latest, windows-latest]
fail-fast: false
name: Test Github action on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: coursier/[email protected]
with:
jvm: ${{ matrix.jvm }}
apps: sbt
- run: sbt publishLocal
working-directory: sbt-plugin
- run: npm version
- run: npm install
- run: npm run all
- name: Run sbt-dependency-submission
uses: ./
id: dependency-submission
with:
working-directory: sbt-plugin
sbt-plugin-version: 3.1.0-SNAPSHOT
- name: Check outputs
run: |
echo ${{ steps.dependency-submission.outputs.submission-id }}
echo ${{ steps.dependency-submission.outputs.submission-api-url }}
echo ${{ steps.dependency-submission.outputs.snapshot-json-path }}
- name: Log snapshot JSON
run: |
cat ${{ steps.dependency-submission.outputs.snapshot-json-path }} | jq
dependency-review:
name: Dependency Review
runs-on: ubuntu-latest
permissions:
pull-requests: write # for comment-summary-in-pr
needs: test-action
if: github.event_name == 'pull_request'
steps:
- name: Dependency Review
uses: actions/dependency-review-action@v3
with:
comment-summary-in-pr: always