forked from enactic/openarm_can
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (148 loc) · 4.73 KB
/
Copy pathpackage.yaml
File metadata and controls
151 lines (148 loc) · 4.73 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
150
151
# Copyright 2025 Enactic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Package
on:
push:
branches:
- '**'
- '!dependabot/**'
tags:
- '**'
pull_request:
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
source:
name: Source
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- name: Create source archive
run: |
rake dist
- uses: actions/upload-artifact@v5
with:
name: source
path: |
openarm-can-*.tar.gz
build:
name: Build
needs: source
strategy:
fail-fast: false
matrix:
id:
- ubuntu-jammy-amd64
- ubuntu-jammy-arm64
- ubuntu-noble-amd64
- ubuntu-noble-arm64
env:
APACHE_ARROW_REPOSITORY: ${{ github.workspace }}/apache-arrow
# condition && true-case || false-case
# ==
# condition ? true-case : false-case
runs-on: >-
${{ (contains(matrix.id, 'arm64') ||
contains(matrix.id, 'aarch64')) && 'ubuntu-24.04-arm' ||
'ubuntu-latest' }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: actions/checkout@v5
with:
path: apache-arrow
repository: apache/arrow
- name: Prepare environment variables
run: |
id=${{ matrix.id }}
# ubuntu-noble-amd64 -> ubuntu-noble
os_version=${id%-*}
# ubuntu-noble -> ubuntu
os=${os_version%-*}
# ubuntu-noble -> noble
version=${os_version##*-}
# ubuntu-noble-amd64 -> amd64
architecture=${id##*-}
if [ "${os}" = "debian" ] || [ "${os}" = "ubuntu" ]; then
TASK_NAMESPACE=apt
if [ "${architecture}" = "amd64" ]; then
echo "APT_TARGETS=${os_version}" >> "${GITHUB_ENV}"
TEST_DOCKER_IMAGE="${os}:${version}"
else
echo "APT_TARGETS=${id}" >> "${GITHUB_ENV}"
TEST_DOCKER_IMAGE="arm64v8/${os}:${version}"
fi
else
TASK_NAMESPACE=yum
# amazon-linux -> amazonlinux
docker_os=${os/-/}
if [ "${architecture}" = "x86_64" ]; then
echo "YUM_TARGETS=${os_version}" >> "${GITHUB_ENV}"
TEST_DOCKER_IMAGE="${docker_os}:${version}"
else
echo "YUM_TARGETS=${id}" >> "${GITHUB_ENV}"
TEST_DOCKER_IMAGE="arm64v8/${docker_os}:${version}"
fi
fi
echo "ARCHITECTURE=${architecture}" >> ${GITHUB_ENV}
echo "TASK_NAMESPACE=${TASK_NAMESPACE}" >> ${GITHUB_ENV}
echo "TEST_DOCKER_IMAGE=${TEST_DOCKER_IMAGE}" >> ${GITHUB_ENV}
- name: Install dependencies
run: |
sudo apt update -o="APT::Acquire::Retries=3"
sudo apt install -y -V -o="APT::Acquire::Retries=3" \
devscripts \
ruby
- uses: actions/download-artifact@v6
with:
name: source
- name: Update version
if: github.ref_type != 'tag'
run: |
cd packages
rake version:update
- name: Login to GitHub Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build with docker
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd packages
rake docker:pull || :
rake ${TASK_NAMESPACE}:build BUILD_DIR=build
if [ "${TASK_NAMESPACE}" = "yum" ] && [ "${ARCHITECTURE}" != "x86_64" ]; then
# Remove SRPMs from non x86_64 artifacts
rm -rf ${TASK_NAMESPACE}/repositories/*/*/source
fi
- name: Push the built Docker image
continue-on-error: true
run: |
cd packages
rake docker:push
# Test
- name: Test
run: |
docker run \
--rm \
--volume ${PWD}:/host:ro \
${TEST_DOCKER_IMAGE} \
/host/packages/${TASK_NAMESPACE}/test.sh