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

Move to GH Actions #1760

Merged
merged 7 commits into from
May 31, 2024
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
16 changes: 16 additions & 0 deletions .github/actions/composite/setup-certificate-1p/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Set up mirror certificates
description: Set up mirror certificates

runs:
using: composite
steps:
- name: Install 1Password CLI
uses: 1password/install-cli-action@v1
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ env.OP_SERVICE_ACCOUNT_TOKEN }}

- name: Update SSL Certificates from 1Password
run: |
op document get --output expensify.ca.crt expensify.ca.crt && sudo cp expensify.ca.crt /usr/local/share/ca-certificates/expensify.ca.crt
sudo update-ca-certificates
shell: bash
90 changes: 90 additions & 0 deletions .github/workflows/bedrock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Bedrock Test Suite
on:
push:
branches: # this ignores tag pushes, and only looks at branches.
- '**'
release:
types: [prereleased]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because we only trigger pre-releases here: https://github.com/Expensify/Bedrock/releases

concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true
env:
CCACHE_BASEDIR: "/home/runner/.cache/ccache"
# Use mirror.bastion1.sjc if running locally
APT_MIRROR_URL: "apt-mirror.expensify.com:843"
jobs:
Run_Bedrock_Tests:
name: "Create Bedrock and Test"
runs-on: ubuntu-20.04-v64 # The biggest and best for my baby
timeout-minutes: 30
steps:

- name: Checkout Bedrock
uses: actions/[email protected]

- name: Get Date for cache
id: get-date
run: |
echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash

- name: Set up cache
uses: actions/[email protected]
with:
path: |-
${{ env.CCACHE_BASEDIR }}
key: "${{ runner.os }}-compilation-${{ github.ref_name }}-${{ github.sha }}"
restore-keys: |
${{ runner.os }}-compilation-${{ github.ref_name }}-
${{ runner.os }}-compilation-

- name: Setup Mirror Certificates
uses: ./.github/actions/composite/setup-certificate-1p
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}

- name: Install packages
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA9EF27F
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C
wget -qO - https://package.perforce.com/perforce.pubkey --no-check-certificate | sudo apt-key add -
echo "deb [arch=amd64] https://travis:${{ secrets.TRAVIS_APT_PASSWORD }}@$APT_MIRROR_URL/mirror/ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update -y
sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install rsyslog cmake gcc-13 g++-13 libsodium-dev libgpgme11-dev libstdc++-13-dev
sudo locale-gen "en_US.UTF-8"
sudo service rsyslog start

- name: Use updated ccache
run: |
wget https://github.com/ccache/ccache/releases/download/v4.8.3/ccache-4.8.3-linux-x86_64.tar.xz
tar -xf ccache-4.8.3-linux-x86_64.tar.xz
sudo cp ccache-4.8.3-linux-x86_64/ccache /usr/local/bin/ccache
ccache -V
ln -s /usr/local/bin/ccache /usr/local/bin/gcc-13
ln -s /usr/local/bin/ccache /usr/local/bin/g++-13

- name: Setup tmate session
if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems kinda long for a big runner, but maybe we rarely debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we rarely debug, and I haven't seen anyone stretch this as of yet

with:
limit-access-to-actor: true

# If tmate was run, we want to mark this step as failed so bedrock tests don't look like they're passing
- name: Mark failure if debugging
if: runner.debug == '1'
run: exit 1

- name: Run tests
run: "./ci_tests.sh"

- name: Upload bedrock binary to release
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_REPOSITORY: "${{ github.repository }}"
with:
files: |-
./bedrock

32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

55 changes: 55 additions & 0 deletions ci_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
set -e

export CXX=g++-13
export CC=gcc-13

# Add the current working directory to $PATH so that tests can find bedrock.
export PATH=$PATH:`pwd`

export CCACHE_COMPILERCHECK="mtime"

# We have include_file_ctime and include_file_mtime since travis never modifies the header file during execution
# and gh actions shouldn't care about ctime and mtime between new branches.
export CCACHE_SLOPPINESS="pch_defines,time_macros,include_file_ctime,include_file_mtime"
export CCACHE_MAXSIZE="1G"

# ccache recommends a compression level of 5 or less for faster compilations.
# Compression speeds up the tar and untar of the cache between travis runs.
export CCACHE_COMPRESS="true"
export CCACHE_COMPRESSLEVEL="1"

mark_fold() {
local action=$1
local name=$2

# if action == end, just print out ::endgroup::
if [[ "$action" == "end" ]]; then
echo ::endgroup::
return
fi

echo "::group::${name}"
}

# don't print out versions until after they are installed
${CC} --version
${CXX} --version

mark_fold start build_bedrock
make -j64
mark_fold end build_bedrock

mark_fold start test_bedrock
cd test
./test -threads 64
cd ..
mark_fold end test_bedrock

mark_fold start test_bedrock_cluster
cd test/clustertest
./clustertest -threads 8
cd ../..
mark_fold end test_bedrock_cluster

strip bedrock
104 changes: 0 additions & 104 deletions travis.sh

This file was deleted.