Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable FIPS for Linux only #231

Merged
merged 4 commits into from
Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ jobs:
strategy:
fail-fast: false # don't fail fast as sometimes failures are operating system specific.
matrix:
os:
- "macos-11"
- "ubuntu-18.04"
mode:
- "default"
# On CI, by default, we use libc++.
- "clang"
- "clang-fips"
include:
- os: macos-11
mode: default
- os: ubuntu-18.04
mode: clang
- os: ubuntu-18.04
mode: clang-fips
steps:
- name: Cancel when duplicated
uses: styfle/[email protected]
Expand Down Expand Up @@ -100,15 +99,15 @@ jobs:

# Prepare clang tooling and config when it is required.
- name: Setup clang
if: matrix.mode == 'clang' || matrix.mode == 'clang-fips'
if: runner.os == 'Linux' && (matrix.mode == 'clang' || matrix.mode == 'clang-fips')
# This downloads the required clang tooling when it is not downloaded yet.
run: |
make clang.bazelrc
echo "BAZEL_FLAGS=--config=libc++" >> $GITHUB_ENV

# Set BAZEL_FLAGS to FIPS mode only when it is required.
- name: Setup FIPS mode
if: matrix.mode == 'clang-fips'
if: runner.os == 'Linux' && matrix.mode == 'clang-fips'
run: echo "BAZEL_FLAGS=--config=libc++ --define=boringssl=fips" >> $GITHUB_ENV

- name: Run all tests
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ jobs:
strategy:
fail-fast: false # don't fail fast as sometimes failures are operating system specific.
matrix:
os:
- "macos-11"
- "ubuntu-18.04"
mode:
- "default"
# By default we use libc++.
- "clang"
- "clang-fips"
include:
- os: macos-11
mode: default
- os: ubuntu-18.04
mode: clang
- os: ubuntu-18.04
mode: clang-fips
steps:
- name: Cancel when duplicated
uses: styfle/[email protected]
Expand Down Expand Up @@ -62,7 +61,7 @@ jobs:

# Prepare clang tooling and config when it is required.
- name: Setup clang
if: matrix.mode == 'clang' || matrix.mode == 'clang-fips'
if: runner.os == 'Linux' && (matrix.mode == 'clang' || matrix.mode == 'clang-fips')
# This downloads the required clang tooling when it is not downloaded yet.
# GITHUB_REF: refs/tags/0.5.1-rc1, resulted VERSION: "0.5.1".
run: |
Expand All @@ -72,7 +71,7 @@ jobs:

# Set BAZEL_FLAGS to FIPS mode only when it is required.
- name: Setup FIPS mode
if: matrix.mode == 'clang-fips'
if: runner.os == 'Linux' && matrix.mode == 'clang-fips'
run: echo "BAZEL_FLAGS=--config=libc++ --define=boringssl=fips" >> $GITHUB_ENV

- name: Create artifacts
Expand Down Expand Up @@ -120,9 +119,6 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
dist-Linux-default/**/*.tar.gz
dist-Linux-clang/**/*.tar.gz
dist-Linux-clang-fips/**/*.tar.gz
dist-macOS-default/**/*.tar.gz
dist-macOS-clang/**/*.tar.gz
dist-macOS-clang-fips/**/*.tar.gz
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ main_target := //src/main:$(binary_name)
# Always use amd64 for bazelisk for build and test rules below, since we don't support for macOS
# arm64 (with --host_javabase=@local_jdk//:jdk) yet (especially the protoc-gen-validate project:
# "no matching toolchains found for types @io_bazel_rules_go//go:toolchain").
bazel := GOARCH=amd64 $(go) run $(bazelisk@v) --output_user_root=$(bazel_cache_dir)
bazel := GOARCH=amd64 $(go) run $(bazelisk@v) $(if $(CI),--output_user_root=$(bazel_cache_dir),)
buildifier := $(go_tools_dir)/buildifier
envsubst := $(go_tools_dir)/envsubst
protodoc := $(go_tools_dir)/protodoc
Expand Down Expand Up @@ -90,7 +90,7 @@ build-%:
dist: dist/$(binary_name)_$(goos)_amd64_$(MODE)_$(VERSION).tar.gz

# Since we don't do cross-compilation yet (probably we can do it later via `zig cc`), we can only
# build artifact for the current `os` and `mode` pair (e.g. {os: 'macOS', mode: 'clang-fips'}).
# build artifact for the current `os` and `mode` pair (e.g. {os: 'linux', mode: 'clang-fips'}).
dist/$(binary_name)_$(goos)_amd64_$(MODE)_$(VERSION).tar.gz: $(stripped_binary) ## Create build artifacts
@$(eval DIST_DIR := $(shell mktemp -d))
@cp -f LICENSE $(DIST_DIR)
Expand Down