Skip to content

Commit 6970455

Browse files
committed
Refactor CI workflows.
1 parent aa78b43 commit 6970455

File tree

3 files changed

+70
-52
lines changed

3 files changed

+70
-52
lines changed

.github/workflows/ci.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: ci
2+
3+
# Build and run all tests.
4+
# - Triggers: All pushes and pull requests on any branch.
5+
# - Runs on: All repositories (including forks)
6+
7+
on:
8+
push:
9+
branches: ['**']
10+
11+
pull_request:
12+
branches: ['**']
13+
14+
workflow_dispatch: # Allows manual dispatch
15+
16+
# Prevents overlapping runs of this workflow on the same branch.
17+
# If multiple commits are pushed in quick succession, only the most recent run will complete.
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
build-and-test:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 10
30+
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v3
33+
34+
- name: Install tools
35+
shell: pwsh
36+
run: |
37+
Install-Module InvokeBuild -Force
38+
39+
- name: Build
40+
shell: pwsh
41+
run: |
42+
Invoke-Build
43+
44+
- name: Test
45+
shell: pwsh
46+
run: |
47+
Invoke-Build Test
48+
49+
- name: Upload logs
50+
uses: actions/upload-artifact@v4
51+
if: always()
52+
with:
53+
name: ci-logs-${{ github.run_id }}
54+
path: generated/logs
55+
retention-days: 7 # Short log retention for CI runs

.github/workflows/on-pull-request.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/publish.yaml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
11
name: publish
22

3+
# Build, test and publish official Docker images.
4+
# - Triggers: Pushes to master and scheduled weekly runs.
5+
# - Runs on: Only the official repository (FirebirdSQL/firebird-docker)
6+
37
on:
48
push:
59
branches:
610
- master
11+
712
schedule:
8-
- cron: "0 0 * * 1"
9-
workflow_dispatch:
13+
- cron: "0 0 * * 1" # Every Monday at midnight
1014

15+
workflow_dispatch: # Allows manual dispatch
16+
17+
# Only a single instance of this workflow can be in execution at a given time.
1118
concurrency:
1219
group: ${{ github.workflow }}
1320

1421
jobs:
15-
16-
build-test-publish:
22+
build-test-and-publish:
1723
if: ${{ github.repository == 'FirebirdSQL/firebird-docker' }}
1824
runs-on: ubuntu-latest
19-
2025
steps:
2126
- name: Checkout
2227
uses: actions/checkout@v4
2328
with:
2429
fetch-depth: 10
2530

31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v3
33+
2634
- name: Install tools
2735
shell: pwsh
2836
run: |
2937
Install-Module InvokeBuild -Force
3038
31-
- name: Set up QEMU
32-
uses: docker/setup-qemu-action@v3
33-
3439
- name: Build
3540
shell: pwsh
3641
run: |
@@ -52,13 +57,10 @@ jobs:
5257
run: |
5358
Invoke-Build Publish
5459
55-
- name: Log out from Docker Hub
56-
run: |
57-
docker logout
58-
5960
- name: Upload logs
6061
uses: actions/upload-artifact@v4
6162
if: always()
6263
with:
63-
name: logs
64+
name: publish-logs-${{ github.run_id }}
6465
path: generated/logs
66+
retention-days: 30 # Longer log retention for published images

0 commit comments

Comments
 (0)