Merge pull request #103 from Workiva/release_scip-dart_1.2.1 #361
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
snapshots: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install scip cli | |
run: | | |
bash -c 'curl -L "https://github.com/sourcegraph/scip/releases/download/v0.3.0/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 relationships-project directory | |
run: dart pub get | |
working-directory: ./snapshots/input/relationships-project | |
- name: Snapshots Diff Check | |
run: | | |
dart run scip_dart ./snapshots/input/basic-project | |
./scip snapshot --to ./snapshots/output/basic-project | |
dart run scip_dart --index-relationships ./snapshots/input/relationships-project | |
./scip snapshot --to ./snapshots/output/relationships-project | |
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 | |
snapshots-diagnostics: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install scip cli | |
run: | | |
bash -c 'curl -L "https://github.com/sourcegraph/scip/releases/download/v0.3.0/scip-linux-amd64.tar.gz"' | tar xzf - scip | |
./scip --version | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: 2.18.7 | |
- name: pub get scip-dart package | |
run: dart pub get | |
- name: pub get diagnostics directory | |
run: dart pub get | |
working-directory: ./snapshots/input/diagnostics | |
- name: Install jq | |
uses: dcarbone/[email protected] | |
- name: Snapshots Diff Check | |
run: | | |
make gen-snap_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: | |
matrix: | |
repo: [ | |
"Workiva/over_react", | |
"Workiva/w_module", | |
"rrousselGit/provider", | |
"dart-lang/args", | |
] | |
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@v3 | |
with: | |
repo: ${{ matrix.repo }} | |
path: ${{ matrix.repo }} | |
- run: dart pub get | |
working-directory: ${{ matrix.repo }} | |
- run: | | |
dart run scip_dart ./${{ matrix.repo }} || exit 1 |