Skip to content

Commit

Permalink
ci: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Nov 17, 2023
1 parent de58094 commit 8f4a36e
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 50 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/amd64_docker.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
# ref: https://github.com/docker-library/official-images
name: amd64 Docker

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
Distros:
runs-on: ubuntu-latest
strategy:
matrix:
#platform: [amd64, arm64, riscv64]
platform: [amd64]
distro: [alpine, archlinux, centos, debian, fedora, opensuse, ubuntu]
fail-fast: false
env:
PLATFORM: ${{ matrix.platform }}
DISTRO: ${{ matrix.distro }}
name: ${{ matrix.platform }} • ${{ matrix.distro }} • Bazel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check docker
run: |
docker info
docker buildx ls
- name: Build env image
run: make --directory=ci ${PLATFORM}_${DISTRO}_env
- name: Build devel project
run: make --directory=ci ${PLATFORM}_${DISTRO}_devel
- name: Build project
run: make --directory=ci ${PLATFORM}_${DISTRO}_build
- name: Test project
run: make --directory=ci ${PLATFORM}_${DISTRO}_test
- uses: actions/checkout@v4
- name: Check docker
run: |
docker info
docker buildx ls
- name: Build env image
run: make --directory=ci ${{ matrix.platform }}_${{ matrix.distro}}_env
- name: Build devel image
run: make --directory=ci ${{ matrix.platform }}_${{ matrix.distro}}_devel
- name: Build project
run: make --directory=ci ${{ matrix.platform }}_${{ matrix.distro}}_build
- name: Test project
run: make --directory=ci ${{ matrix.platform }}_${{ matrix.distro}}_test
17 changes: 8 additions & 9 deletions .github/workflows/amd64_linux.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
# ref: https://github.com/actions/runner-images
name: amd64 Linux

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

# Building using the github runner environement directly.
jobs:
# Building using the github runner environement directly.
linux:
native:
name: Linux • Bazel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Bazel
run: |
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
sudo apt-get update
sudo apt-get install bazel
- name: Check bazel
run: bazel version
- name: Check Bazel
run: bazel version
- name: Build
run: >
bazel build
-c opt
--cxxopt="-std=c++20"
--subcommands=true
--subcommands=pretty_print
...
- name: Test
run: >
bazel test
-c opt
--cxxopt="-std=c++20"
--test_output=errors
...
15 changes: 7 additions & 8 deletions .github/workflows/amd64_macos.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# ref: https://github.com/actions/runner-images
name: amd64 macOS
name: amd64 MacOS

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

# Building using the github runner environement directly.
jobs:
# Building using the github runner environement directly.
macos:
native:
name: MacOS • Bazel
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Bazel
run: |
brew update
Expand All @@ -20,13 +21,11 @@ jobs:
run: >
bazel build
-c opt
--cxxopt="-std=c++20"
--subcommands=true
--subcommands=pretty_print
...
- name: Test
run: >
bazel test
-c opt
--cxxopt="-std=c++20"
--test_output=errors
...
16 changes: 7 additions & 9 deletions .github/workflows/amd64_windows.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# ref: https://github.com/actions/runner-images
name: amd64 Windows

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

# Building using the github runner environement directly.
jobs:
# Building using the github runner environement directly.
windows:
native:
strategy:
matrix:
# VS-2022 broken see https://github.com/bazelbuild/bazel/issues/18592
runner: [windows-2022, windows-2019]
runner: [windows-2022]
fail-fast: false # Don't cancel all jobs if one fails.
name: ${{ matrix.runner }} • Bazel
runs-on: ${{ matrix.runner }}
#runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Bazel
run: choco install bazel
- name: Check Bazel
Expand All @@ -23,13 +23,11 @@ jobs:
run: >
bazel build
-c opt
--cxxopt="/std:c++20"
--subcommands=true
--subcommands=pretty_print
...
- name: Test
run: >
bazel test
-c opt
--cxxopt="/std:c++20"
--test_output=errors
...
35 changes: 29 additions & 6 deletions ci/docker/fedora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,44 @@ FROM fedora:latest AS env
# Install system build dependencies
ENV PATH=/usr/local/bin:$PATH
RUN dnf -y update \
&& dnf -y install git \
&& dnf -y install git wget \
&& dnf -y groupinstall "Development Tools" \
&& dnf -y install gcc-c++ zlib-devel \
&& dnf -y install dnf-plugins-core \
&& dnf -y copr enable vbatts/bazel \
&& dnf -y install bazel4 \
&& dnf -y install which \
&& dnf clean all

# Install Bazelisk
RUN wget \
https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64 \
&& chmod +x bazelisk-linux-amd64 \
&& mv bazelisk-linux-amd64 /usr/local/bin/bazel

# Install Java
RUN dnf -y update \
&& dnf -y install java-11-openjdk java-11-openjdk-devel maven \
&& dnf clean all
ENV JAVA_HOME=/usr/lib/jvm/java-openjdk

# Install Python
RUN dnf -y update \
&& dnf -y install python3 python3-devel python3-pip \
&& dnf clean all

FROM env AS devel
WORKDIR /home/project
COPY . .

FROM devel as build
FROM devel AS build
RUN bazel version
RUN bazel build -c opt --cxxopt=-std=c++20 //main:template
RUN bazel build \
-c opt \
--subcommands=true \
//main:template

FROM build as test
RUN bazel test --test_output=all -c opt --cxxopt=-std=c++20 //main:all
FROM build AS test
RUN bazel test \
-c opt \
--test_output=errors \
//main/...

0 comments on commit 8f4a36e

Please sign in to comment.