Skip to content

Commit 0d04914

Browse files
committed
simplify PR action
1 parent a7bd141 commit 0d04914

File tree

1 file changed

+15
-62
lines changed

1 file changed

+15
-62
lines changed

.github/workflows/pr.yml

Lines changed: 15 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,75 +4,28 @@ on:
44
pull_request:
55

66
jobs:
7-
check:
8-
name: Check for file modification
9-
outputs:
10-
run_job: ${{ steps.check_files.outputs.run_job }}
7+
build-sss-f:
118
runs-on: ubuntu-latest
129
steps:
1310
- uses: actions/checkout@v2
11+
- uses: actions/setup-dotnet@v1
1412
with:
15-
fetch-depth: 2
16-
- name: Run checker
17-
id: check_files
18-
run: |
19-
echo "List modified files"
20-
git diff --name-only HEAD^ HEAD
21-
echo "Check paths of modified files"
22-
git diff --name-only HEAD^ HEAD >files.txt
23-
24-
sssf=false
25-
sssfp=false
26-
27-
while IFS= read -r file; do
28-
echo $file
29-
if [[ $file == src/SqlStreamStore.FSharp/* ]]; then
30-
sssf=true
31-
elif [[ $file == src/SqlStreamStore.FSharp.Postgres/* ]]; then
32-
sssfp=true
33-
fi
34-
done <files.txt
35-
36-
rm -f files.txt
37-
38-
if [ $sssf = true ] && [ $sssfp = true ]; then
39-
echo "::set-output name=run_jobs:all"
40-
elif [ $sssf = true ] && [ $sssfp = false ]; then
41-
echo "::set-output name=run_jobs:sssf"
42-
elif [ $sssf = false ] && [ $sssfp = true ]; then
43-
echo "::set-output name=run_jobs:sssfp"
44-
else
45-
echo "::set-output name=run_jobs:none"
46-
fi
47-
48-
build-sss-f:
49-
needs: check
50-
if: ${{ needs.check.outputs.run_job }} == 'all' || ${{ needs.check.outputs.run_job }} == 'sssf'
51-
strategy:
52-
matrix:
53-
os: [ ubuntu-latest, macos-latest, windows-latest ]
54-
fail-fast: false
55-
runs-on: ${{ matrix.os }}
56-
name: Build on ${{ matrix.os }} using dotnet version ${{ matrix.dotnet }}
57-
steps:
58-
- uses: actions/checkout@v2
13+
dotnet-version: '6.0.x'
14+
- name: Restore
15+
run: dotnet restore
5916
- name: Build
60-
run: cd src/SqlStreamStore.FSharp; dotnet build --configuration Release
17+
working-directory: src/SqlStreamStore.FSharp
18+
run: dotnet build --no-restore --configuration Release
6119

6220
build-sss-f-postgres:
63-
needs: check
64-
if: ${{ needs.check.outputs.run_job }} == 'all' || ${{ needs.check.outputs.run_job }} == 'sssfp'
65-
strategy:
66-
matrix:
67-
os: [ ubuntu-latest, macos-latest, windows-latest ]
68-
fail-fast: false
69-
runs-on: ${{ matrix.os }}
70-
name: Build on ${{ matrix.os }} using dotnet version ${{ matrix.dotnet }}
21+
runs-on: ubuntu-latest
7122
steps:
7223
- uses: actions/checkout@v2
24+
- uses: actions/setup-dotnet@v1
25+
with:
26+
dotnet-version: '6.0.x'
27+
- name: Restore
28+
run: dotnet restore
7329
- name: Build
74-
run: cd src/SqlStreamStore.FSharp.Postgres; dotnet build --configuration Release
75-
76-
# Put back when you add tests
77-
# - name: Test
78-
# run: dotnet test --no-restore
30+
working-directory: src/SqlStreamStore.FSharp.Postgres
31+
run: dotnet build --no-restore --configuration Release

0 commit comments

Comments
 (0)