Skip to content

Commit 0ba8d77

Browse files
committed
update workflows
1 parent 4ed5dc6 commit 0ba8d77

File tree

2 files changed

+26
-32
lines changed

2 files changed

+26
-32
lines changed

.github/workflows/docker.yml .github/workflows/cicd.yml

+26-14
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,64 @@
1-
name: Create and publish a Docker image
2-
on:
3-
workflow_run:
4-
workflows: [ "Rust" ]
5-
branches: [ "main" ]
6-
types:
7-
- completed
1+
name: CICD
2+
3+
on: [ "push", "pull_request" ]
84

95
env:
6+
CARGO_TERM_COLOR: always
107
REGISTRY: ghcr.io
118
IMAGE_NAME: ${{ github.repository }}
129

1310
jobs:
14-
build-and-push-image:
11+
tests:
1512
runs-on: ubuntu-latest
16-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
- run: sudo apt install libpcap-dev libsasl2-dev libssl-dev
16+
- name: Build
17+
run: cargo build --verbose
18+
- name: Run tests
19+
run: cargo test --verbose
20+
21+
docker:
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: [ubuntu-24.04, ubuntu-24.04-arm]
1726

1827
permissions:
1928
contents: read
2029
packages: write
2130
attestations: write
2231
id-token: write
2332

33+
runs-on: ${{ matrix.os }}
34+
needs: [ tests ]
2435
steps:
2536
- name: Checkout repository
2637
uses: actions/checkout@v4
2738

2839
- name: Log in to the Container registry
29-
uses: docker/login-action@327cd5a69de6c009b9ce71bce8395f28e651bf99
40+
uses: docker/login-action@v3
3041
with:
3142
registry: ${{ env.REGISTRY }}
3243
username: ${{ github.actor }}
3344
password: ${{ secrets.GITHUB_TOKEN }}
3445

3546
- name: Extract metadata (tags, labels) for Docker
3647
id: meta
37-
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804
48+
uses: docker/metadata-action@v5
3849
with:
3950
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4051

41-
- name: Sync theme submodule
42-
run: git submodule sync && git submodule update --init --recursive
52+
- name: Set up Docker Buildx
53+
uses: docker/setup-buildx-action@v3
4354

4455
- name: Build and push Docker image
4556
id: push
46-
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
57+
uses: docker/build-push-action@v6
4758
with:
4859
context: .
4960
push: true
61+
provenance: false
5062
tags: ${{ steps.meta.outputs.tags }}
5163
labels: ${{ steps.meta.outputs.labels }}
5264

.github/workflows/rust.yml

-18
This file was deleted.

0 commit comments

Comments
 (0)