-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (87 loc) · 2.77 KB
/
ci.yaml
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
name: Tests
on:
pull_request:
push:
branches:
- master
permissions:
pull-requests: write
contents: write
id-token: write
jobs:
checks:
uses: Workiva/gha-dart-oss/.github/workflows/[email protected]
sbom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: 2.19.6
- uses: anchore/sbom-action@v0
with:
path: ./
format: cyclonedx-json
snapshots:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install scip cli
run: |
bash -c 'curl -L "https://github.com/sourcegraph/scip/releases/download/v0.3.3/scip-linux-amd64.tar.gz"' | tar xzf - scip
./scip --version
- uses: dart-lang/setup-dart@v1
with:
# use a fixed version number so changes to 'stable', dont break snapshot diffs (language version is used in the scip symbol)
sdk: 2.19.6
- name: dart pub get scip-dart package
run: dart pub get
- name: dart pub get basic-project directory
run: dart pub get
working-directory: ./snapshots/input/basic-project
- name: dart pub get diagnostics directory
run: dart pub get
working-directory: ./snapshots/input/diagnostics
- name: Snapshots Diff Check
run: |
dart run scip_dart ./snapshots/input/basic-project
./scip snapshot --to ./snapshots/output/basic-project
dart run scip_dart ./snapshots/input/diagnostics
./scip snapshot --to ./snapshots/output/diagnostics
if [[ -z "$(git status --porcelain ./snapshots/output)" ]];
then
echo "No changes to snapshot files"
else
echo
echo "Snapshot diff detected differences, run 'make gen-snaps' to re-generate snapshots"
git status --short ./snapshots/output
echo
exit 1
fi
consumer:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
consumer: [
{ repo: "Workiva/over_react" },
{ repo: "Workiva/w_module" },
{ repo: "dart-lang/args", ref: "v2.4.2" } # master requires dart 3
]
steps:
# Setup scip-dart
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: 2.19.6
- run: dart pub get
# Setup repo to run on
- uses: actions/checkout@v4
with:
repository: ${{ matrix.consumer.repo }}
path: ${{ matrix.consumer.repo}}
ref: ${{ matrix.consumer.ref || 'master' }}
- run: dart pub get
working-directory: ${{ matrix.consumer.repo }}
- run: |
dart run scip_dart ./${{ matrix.consumer.repo }} || exit 1