Repository navigation
149 lines (144 loc) · 6.46 KB
/
Copy pathci.yaml
File metadata and controls
149 lines (144 loc) · 6.46 KB
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
145
146
147
148
149
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
# Cancel previous runs of the same PR or branch, except on main.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}${{ github.ref_name == 'main' && format('-{0}', github.run_id) || '' }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build:
uses: ./.github/workflows/build.yaml
secrets:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
e2e:
# Runs e2e/smoke_test, which consumes the public API (dnf5-prebuilt/) like
# a user would, against the archives built above on Linux and macOS.
name: e2e (${{ matrix.platform }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
platform: linux-amd64
ol10_image: ol10_curl_amd64_image
ol10_load_target: load_ol10_curl_amd64_image
scratch_image: ol10_scratch_curl_amd64_image
scratch_load_target: load_ol10_scratch_curl_amd64_image
- os: ubuntu-24.04-arm
platform: linux-arm64
ol10_image: ol10_curl_arm64_image
ol10_load_target: load_ol10_curl_arm64_image
scratch_image: ol10_scratch_curl_arm64_image
scratch_load_target: load_ol10_scratch_curl_arm64_image
- os: macos-15
platform: darwin-arm64
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
lfs: true
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: dnf5
path: dist
- uses: ./.github/actions/setup-bazel
with:
buildbuddy-endpoint: ${{ vars.BUILDBUDDY_ENDPOINT }}
buildbuddy-api-key: ${{ secrets.BUILDBUDDY_API_KEY }}
- name: Smoke test
working-directory: e2e/smoke_test
run: >
bazel --bazelrc=../../.github/workflows/ci.bazelrc test //...
--repo_env=DNF5_PREBUILT_DIST_DIR=${{ github.workspace }}/dist
- name: Build Oracle Linux 10 container image
if: runner.os == 'Linux'
working-directory: e2e/smoke_test
run: >
bazel --bazelrc=../../.github/workflows/ci.bazelrc build //:${{ matrix.ol10_image }}
--repo_env=DNF5_PREBUILT_DIST_DIR=${{ github.workspace }}/dist
- name: Load Oracle Linux 10 container image into Docker
if: runner.os == 'Linux'
working-directory: e2e/smoke_test
run: >
bazel --bazelrc=../../.github/workflows/ci.bazelrc run //:${{ matrix.ol10_load_target }}
--repo_env=DNF5_PREBUILT_DIST_DIR=${{ github.workspace }}/dist
- name: Run curl --version in Oracle Linux 10 container
if: runner.os == 'Linux'
run: docker run --network none --rm localhost/e2e-ol10-curl-test:latest curl --version
- name: Scratch image e2e test
working-directory: e2e/scratch_image
run: >
bazel --bazelrc=../../.github/workflows/ci.bazelrc test //...
--repo_env=DNF5_PREBUILT_DIST_DIR=${{ github.workspace }}/dist
- name: Build Oracle Linux 10 scratch container image
if: runner.os == 'Linux'
working-directory: e2e/scratch_image
run: >
bazel --bazelrc=../../.github/workflows/ci.bazelrc build //:${{ matrix.scratch_image }}
--repo_env=DNF5_PREBUILT_DIST_DIR=${{ github.workspace }}/dist
- name: Load Oracle Linux 10 scratch container image into Docker
if: runner.os == 'Linux'
working-directory: e2e/scratch_image
run: >
bazel --bazelrc=../../.github/workflows/ci.bazelrc run //:${{ matrix.scratch_load_target }}
--repo_env=DNF5_PREBUILT_DIST_DIR=${{ github.workspace }}/dist
- name: Run curl --version in Oracle Linux 10 scratch container
if: runner.os == 'Linux'
run: docker run --network none --rm localhost/e2e-ol10-scratch-curl:latest curl --version
- name: Load OL9 container image into Docker
if: matrix.platform == 'linux-amd64'
working-directory: e2e/smoke_test
run: >
bazel --bazelrc=../../.github/workflows/ci.bazelrc run //:load_ol9_curl_image
--repo_env=DNF5_PREBUILT_DIST_DIR=${{ github.workspace }}/dist
- name: Validate OL9 container execution offline
if: matrix.platform == 'linux-amd64'
working-directory: e2e/smoke_test
run: ./validate_image.sh localhost/e2e-curl-test:latest
- name: Collect artifacts
if: runner.os == 'Linux' && always()
run: |
mkdir -p artifacts
cp -f e2e/smoke_test/bazel-bin/*.lock.json artifacts/ || true
cp -f e2e/smoke_test/bazel-bin/*rpmdb*.sqlite artifacts/ || true
cp -f e2e/scratch_image/bazel-bin/*.lock.json artifacts/ || true
cp -f e2e/scratch_image/bazel-bin/*rpmdb*.sqlite artifacts/ || true
docker save -o artifacts/ol10_curl_image.tar localhost/e2e-ol10-curl-test:latest || true
docker save -o artifacts/ol10_scratch_curl_image.tar localhost/e2e-ol10-scratch-curl:latest || true
if [ "${{ matrix.platform }}" = "linux-amd64" ]; then
docker save -o artifacts/ol9_curl_image.tar localhost/e2e-curl-test:latest || true
fi
mkdir -p artifacts/scripts
find e2e/scratch_image/bazel-bin/external -name "*-script" 2>/dev/null | while read -r f; do
pkg=$(basename $(dirname "$f"))
name=$(basename "$f")
cp -f "$f" "artifacts/scripts/${pkg}_${name}"
done
ls -la artifacts/
ls -la artifacts/scripts/ || true
- name: Upload e2e artifacts
if: runner.os == 'Linux' && always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: e2e-artifacts-${{ matrix.platform }}
path: artifacts/
if-no-files-found: warn
buildifier:
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
lfs: true
- uses: ./.github/actions/setup-bazel
with:
buildbuddy-endpoint: ${{ vars.BUILDBUDDY_ENDPOINT }}
buildbuddy-api-key: ${{ secrets.BUILDBUDDY_API_KEY }}
- name: Check Starlark formatting and pre-commit config
run: >
bazel --bazelrc=.github/workflows/ci.bazelrc test
//:buildifier_test //hooks:test