Skip to content

CI: Don't update preinstalled packages (#69) #80

CI: Don't update preinstalled packages (#69)

CI: Don't update preinstalled packages (#69) #80

Workflow file for this run

# Copyright 2022-2024 Sutou Kouhei <kou@clear-code.com>
#
# 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
- pull_request
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
source:
name: Source
runs-on: ubuntu-latest
steps:
- name: Prepare
run: |
case ${GITHUB_REF} in
refs/tags/*)
version=${GITHUB_REF#refs/tags/}
;;
*)
version=${GITHUB_SHA}
;;
esac
echo "VERSION=${version}" >> ${GITHUB_ENV}
- uses: actions/checkout@v4
with:
submodules: true
path: datafusion-c-${{ env.VERSION }}
- name: Archive
run: |
rm -rf datafusion-c-${VERSION}/.git
tar cvzf datafusion-c-${VERSION}.tar.gz datafusion-c-${VERSION}
zip -r datafusion-c-${VERSION}.zip datafusion-c-${VERSION}
- uses: actions/upload-artifact@v4
with:
name: tar.gz
path: datafusion-c-${{ env.VERSION }}.tar.gz
- uses: actions/upload-artifact@v4
with:
name: zip
path: datafusion-c-${{ env.VERSION }}.zip
- name: Release
if: |
startsWith(github.ref, 'refs/tags/')
run: |
gh release create ${GITHUB_REF_NAME} \
--discussion-category Announcements \
--notes-file datafusion-c-${VERSION}/doc/source/news/${VERSION}.md \
--title "DataFucion C ${VERSION}" \
datafusion-c-${VERSION}.tar.gz
datafusion-c-${VERSION}.zip
env:
GH_TOKEN: ${{ github.token }}
build:
name: Build
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
label:
# - AlmaLinux 8 aarch64
- AlmaLinux 8 x86_64
# - AlmaLinux 9 aarch64
- AlmaLinux 9 x86_64
- Debian GNU/Linux bullseye amd64
# - Debian GNU/Linux bullseye arm64
- Debian GNU/Linux bookworm amd64
# - Debian GNU/Linux bookworm arm64
- Ubuntu Focal amd64
# - Ubuntu Focal arm64
- Ubuntu Jammy amd64
# - Ubuntu Jammy arm64
include:
- label: AlmaLinux 8 x86_64
id: almalinux-8-x86_64
task-namespace: yum
target: almalinux-8
test-docker-image: almalinux:8
# - label: AlmaLinux 8 aarch64
# id: almalinux-8-aarch64
# task-namespace: yum
# target: almalinux-8-aarch64
# test-docker-image: arm64v8/almalinux:8
- label: AlmaLinux 9 x86_64
id: almalinux-9-x86_64
task-namespace: yum
target: almalinux-9
test-docker-image: almalinux:9
# - label: AlmaLinux 9 aarch64
# id: almalinux-9-aarch64
# task-namespace: yum
# target: almalinux-9-aarch64
# test-docker-image: arm64v8/almalinux:9
- label: Debian GNU/Linux bullseye amd64
id: debian-bullseye-amd64
task-namespace: apt
target: debian-bullseye
test-docker-image: debian:bullseye
# - label: Debian GNU/Linux bullseye arm64
# id: debian-bullseye-arm64
# task-namespace: apt
# target: debian-bullseye-arm64
# test-docker-image: arm64v8/debian:bullseye
- label: Debian GNU/Linux bookworm amd64
id: debian-bookworm-amd64
task-namespace: apt
target: debian-bookworm
test-docker-image: debian:bookworm
# - label: Debian GNU/Linux bookworm arm64
# id: debian-bookworm-arm64
# task-namespace: apt
# target: debian-bookworm-arm64
# test-docker-image: arm64v8/debian:bookworm
- label: Ubuntu Focal amd64
id: ubuntu-focal-amd64
task-namespace: apt
target: ubuntu-focal
test-docker-image: ubuntu:focal
# - label: Ubuntu Focal arm64
# id: ubuntu-focal-arm64
# task-namespace: apt
# target: ubuntu-focal-arm64
# test-docker-image: arm64v8/ubuntu:focal
- label: Ubuntu Jammy amd64
id: ubuntu-jammy-amd64
task-namespace: apt
target: ubuntu-jammy
test-docker-image: ubuntu:jammy
# - label: Ubuntu Jammy arm64
# id: ubuntu-jammy-arm64
# task-namespace: apt
# target: ubuntu-jammy-arm64
# test-docker-image: arm64v8/ubuntu:jammy
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: |
sudo apt update
sudo apt -V install \
devscripts \
qemu-user-static \
ruby
- name: Update version
if: |
!startsWith(github.ref, 'refs/tags/')
run: |
cd package
rake version:update RELEASE_DATE=$(date +%Y-%m-%d)
- name: Cache ccache
uses: actions/cache@v4
with:
path: package/${{ matrix.task-namespace }}/build/${{ matrix.target }}/ccache
key: package-${{ matrix.id }}-ccache-${{ hashFiles('datafusion-glib/**/*.{c,h}', 'src/**/*.rs') }}
restore-keys: package-${{ matrix.id }}-ccache-
- name: Build with docker
run: |
cd package
rake ${{ matrix.task-namespace }}:build BUILD_DIR=build
env:
APT_TARGETS: ${{ matrix.target }}
YUM_TARGETS: ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: package-${{ matrix.id }}
path: package/${{ matrix.task-namespace }}/repositories/
- name: Create assets
if: |
startsWith(github.ref, 'refs/tags/')
run: |
mkdir -p ${{ matrix.id }}
shopt -s globstar
cp -a package/${{ matrix.task-namespace }}/repositories/**/*.* ${{ matrix.id }}/
tar czf ${{ matrix.id }}.tar.gz ${{ matrix.id }}
- name: Upload to release
if: |
startsWith(github.ref, 'refs/tags/')
run:
gh release upload ${GITHUB_REF_NAME} \
${{ matrix.id }}.tar.gz
env:
GH_TOKEN: ${{ github.token }}
- name: Test
run: |
docker run \
--rm \
--volume ${PWD}:/host:ro \
${{ matrix.test-docker-image }} \
/host/package/${{ matrix.task-namespace }}/test.sh \
local