Skip to content

Commit d8afdc6

Browse files
committed
add test and checks workflows
1 parent efbde80 commit d8afdc6

File tree

3 files changed

+128
-0
lines changed

3 files changed

+128
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Block Merge if "do-not-merge" Label Exists
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- labeled
8+
- unlabeled
9+
- synchronize # important for when new commits are pushed
10+
11+
jobs:
12+
check-do-not-merge-label:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check for "do-not-merge" label
16+
if: contains(github.event.pull_request.labels.*.name, 'do-not-merge')
17+
run: |
18+
echo "This Pull Request has the 'do-not-merge' label. Merging is blocked."
19+
echo "Please remove the 'do-not-merge' label to enable merging."
20+
exit 1 # This will cause the workflow to fail

.github/workflows/checks.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Run Checks
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
# In the same branch only 1 workflow per time can run. In case we're not in the
10+
# main branch we cancel previous running workflow
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
14+
15+
permissions:
16+
contents: read
17+
# Used by the buf to create a comment with a brief summary of failing tets
18+
pull-requests: write
19+
20+
jobs:
21+
run-checks:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: dprint/check@v2.2
27+
with:
28+
dprint-version: 0.48.0
29+
30+
- uses: golangci/golangci-lint-action@v8
31+
with:
32+
version: v2.4.0
33+
args: --timeout 300s
34+
35+
- name: Check go mod
36+
run: |
37+
go mod tidy
38+
git diff --color --exit-code
39+
40+
# This is required to allow licensee/setup-licensed to install Licensed via Ruby gem.
41+
- name: Install Ruby
42+
uses: ruby/setup-ruby@v1
43+
with:
44+
ruby-version: ruby # Install latest version
45+
- name: Install licensed
46+
uses: licensee/setup-licensed@v1.3.2
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
version: 5.x
50+
51+
- name: Run deb copyright check
52+
run: |
53+
go tool task update-deb-copyright
54+
git diff --color --exit-code

.github/workflows/go-test.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Run Go Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
GO_VERSION: "1.25.1"
11+
12+
jobs:
13+
go-test-orchestrator:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: install dependencies
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y android-tools-adb
20+
21+
- name: Checkout code
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: ${{ env.GO_VERSION }}
28+
29+
- name: Run `orchestrator` tests
30+
run: go test task test:orchestrator
31+
32+
go-test-pkg:
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
matrix:
36+
os: [ubuntu-latest, windows-latest]
37+
38+
steps:
39+
- name: install dependencies [Linux]
40+
if: runner.os == 'Linux'
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y android-tools-adb
44+
45+
- name: Checkout code
46+
uses: actions/checkout@v3
47+
48+
- name: Set up Go
49+
uses: actions/setup-go@v5
50+
with:
51+
go-version: ${{ env.GO_VERSION }}
52+
53+
- name: Run `pkg` tests
54+
run: go tool task test:pkg

0 commit comments

Comments
 (0)