-
Notifications
You must be signed in to change notification settings - Fork 5
144 lines (114 loc) · 4.61 KB
/
standard-workflow.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Standard Workflow
on: workflow_call
jobs:
code-style-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run simple checks
run: |
PATH=$PATH:./scripts
set -x
enforce-issue-number-for-todos
enforce-newline-at-eof
prohibit-trailing-whitespace
npm install --global remark-cli remark-lint-no-dead-urls remark-validate-links
validate-markdown-links
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
- name: Check code style
# Curiously, scalafmtCheckAll doesn't cover *.sbt files, hence scalafmtSbtCheck is needed as well
run: sbt scalafmtCheckAll scalafmtSbtCheck "scalafixAll --check"
- name: Substitute sbt plugin snapshot version
run: ./scripts/substitute-sbt-plugin-snapshot-version
- name: Check code style - examples/event-migration
run: sbt scalafmtCheckAll scalafmtSbtCheck "scalafixAll --check"
working-directory: examples/event-migration
- name: Check code style - examples/akka-cluster-app
run: sbt scalafmtCheckAll scalafmtSbtCheck "scalafixAll --check"
working-directory: examples/akka-cluster-app
- name: Check code style - examples/akka-persistence-app
run: sbt scalafmtCheckAll scalafmtSbtCheck "scalafixAll --check"
working-directory: examples/akka-persistence-app
test-212:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
- name: Compile
run: sbt compile Test/compile
- name: Run tests
run: |
sbt "++ 2.12.16 test"
sbt "++ 2.12.17 test"
sbt "++ 2.12.18 test"
sbt "++ 2.12.19 test"
test-213:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
- name: Compile
run: sbt compile Test/compile
- name: Run tests
run: |
sbt "++ 2.13.14 test"
test-sbt-plugin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
- name: Test sbt plugin
run: sbt scripted
run-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: coursier/cache-action@v6
- uses: coursier/setup-action@v1
- name: Substitute sbt plugin snapshot version
run: ./scripts/substitute-sbt-plugin-snapshot-version
- name: Test event-migration-examples
run: sbt test
working-directory: examples/event-migration
- name: Compile akka-cluster-app
run: sbt compile
working-directory: examples/akka-cluster-app
- name: Test akka-persistence-app
run: sbt test
working-directory: examples/akka-persistence-app
# <PEKKO-REMOVE-START>
patch-and-push-to-psh:
if: github.event_name != 'pull_request'
needs: [code-style-check, test-212, test-213, test-sbt-plugin, run-examples]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Fetch all history so that a push to pekko-serialization-helper succeeds.
# See https://stackoverflow.com/q/76470864
fetch-depth: 0
- run: git status
- run: git checkout -b TEMP/from-ash
- run: curl -sL https://raw.githubusercontent.com/ap/rename/master/rename | sudo tee /usr/local/bin/rename
- run: sudo chmod +x /usr/local/bin/rename
- run: ./scripts/akka-to-pekko
- run: git add .
- run: git config user.email "psh@virtuslab.com"
- run: git config user.name "Pekko Serialization Helper Bot"
- run: git commit -m 'Migrate `main` branch from from akka-serialization-helper'
- env:
# 2.1 Generate an SSH key in terminal (Leave the passphrase empty)
# 2.2 Add public key in the external repository: <external repository>/Settings/Deploy keys/Add deploy key
# Paste the public key. Enable "Allow write access"
# 2.3 Add private key in the source repository: <external repository>/Settings/Secrets/Actions/New repository secret
# Paste the private key.
PSH_SSH_PRIVATE_KEY: ${{ secrets.PSH_SSH_PRIVATE_KEY }}
run: mkdir -p ~/.ssh/ && echo "$PSH_SSH_PRIVATE_KEY" > ~/.ssh/psh && chmod 400 ~/.ssh/psh
- run: git config core.sshCommand "ssh -i $HOME/.ssh/psh"
- run: git push --force git@github.com:VirtusLab/pekko-serialization-helper.git HEAD:main
# <PEKKO-REMOVE-END>
###