Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #10151
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Github worflow to test Agora on a variety of platforms | |
# | |
# Also uploads the documentation to Github pages. | |
# | |
# Note: | |
# - Try to use the native Github action syntax (${{ expression }}) when possible, | |
# as they are substituted with their value in the logs, unlike env variable. | |
# For example use `${{ github.workspace }}` over `${GITHUB_WORKSPACE}` | |
name: CI | |
on: [push, pull_request] | |
jobs: | |
main: | |
name: Run | |
# The configuration matrix: We define all possible combinations here, | |
# then add excludes for things we don't want to test, | |
# and include to specify job-specific data. | |
strategy: | |
# Disable `fail-fast` because we want the whole test suite to run even if one | |
# of the nigthly is broken | |
fail-fast: false | |
matrix: | |
## TODO: Re-enable once memory usage while reducing Agora is reduced | |
## Currently it takes 7GB+ which OOM on the CI. | |
## See https://github.com/ldc-developers/ldc/issues/3702 | |
# os: [ ubuntu-20.04, macOS-11, windows-2019 ] | |
os: [ ubuntu-20.04, macOS-11] | |
dc: [ ldc-1.28.1 ] | |
# Define job-specific parameters | |
include: | |
# By default, don't generate artifacts nor run extra checks for push | |
- { artifacts: false, run_extra_checks: false } | |
# Only generate when the latest ldc is used | |
# IMPORTANT: Update this when the compiler support is changed! | |
- { dc: ldc-1.28.1, artifacts: true, run_extra_checks: true } | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 60 | |
env: | |
TRACY_NO_INVARIANT_CHECK: 1 | |
steps: | |
# Checkout this repository and its submodules | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
persist-credentials: false | |
# Install the D compiler | |
- name: Prepare compiler | |
uses: dlang-community/setup-dlang@v1 | |
with: | |
compiler: ${{ matrix.dc }} | |
# Install os-specific packages | |
# Those will show up in the list of steps, but be grayed out, | |
# hence the usage of the `[OSX]` tag | |
- name: '[OSX] Install dependencies & setup environment' | |
if: runner.os == 'macOS' | |
run: | | |
brew install coreutils libsodium pkg-config | |
echo "LIBRARY_PATH=${LD_LIBRARY_PATH-}:/usr/local/lib/" >> $GITHUB_ENV | |
echo "PKG_CONFIG_PATH=/usr/local/opt/sqlite/lib/pkgconfig:/usr/local/opt/[email protected]/lib/pkgconfig/" >> $GITHUB_ENV | |
- name: '[Linux] Install dependencies & setup environment' | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libsodium-dev libsqlite3-dev clang | |
- name: '[Windows] Install dependencies & setup environment' | |
if: runner.os == 'Windows' | |
shell: powershell | |
run: | | |
$url = "https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18-msvc.zip" | |
$sha256hash = "C1D48D85C9361E350931FFE5067559CD7405A697C655D26955FB568D1084A5F4" | |
Write-Host ('Downloading {0} ...' -f $url) | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
# See https://github.com/PowerShell/PowerShell/issues/2138 | |
$ProgressPreference = 'SilentlyContinue' | |
New-Item -ItemType directory -Path ${{ github.workspace }}\lib\ | |
Invoke-WebRequest -Uri $url -OutFile '${{ github.workspace }}\lib\libsodium.zip' | |
if ((Get-FileHash '${{ github.workspace }}\lib\libsodium.zip' -Algorithm "SHA256").Hash -ne $sha256hash) { | |
exit 1 | |
} | |
Expand-Archive '${{ github.workspace }}\lib\libsodium.zip' -DestinationPath ${{ github.workspace }}\lib\ | |
# Add whatever debugging information can be useful in the long run here | |
- name: Print system information | |
shell: bash | |
run: | | |
${DC} --version | |
dub --version | |
# GeoIP is required for one of the integration test | |
# We cache it via the cache action, and otherwise download it, | |
# but this requires a license key (which is a secret in the repository). | |
- name: 'Get the current date' | |
id: get-date | |
shell: bash | |
run: | | |
echo "::set-output name=date::$(/bin/date -u '+%Y%m')" | |
- name: 'Load GeoIP from cache' | |
id: cache-geoip | |
if: runner.os != 'Windows' | |
uses: actions/cache@v2 | |
with: | |
path: ${{ github.workspace }}/build/geoip/ | |
# Note: Cached data gets evicted after 7 days of being unused | |
# In order to avoid being stuck with a very old MMDB, | |
# we use the month as an index to the cache. | |
key: cache-geoip-${{ steps.get-date.outputs.date }} | |
- name: 'Download GeoIP database' | |
if: runner.os != 'Windows' && steps.cache-geoip.outputs.cache-hit != 'true' | |
env: | |
GEOIP_OUTPUT_DIR: ${{ github.workspace }}/build/geoip/ | |
run: | | |
mkdir ${GEOIP_OUTPUT_DIR} | |
wget --no-verbose -O ${GEOIP_OUTPUT_DIR}/geoip.city.tar.gz 'https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${{ secrets.GEOIP_SECRET }}&suffix=tar.gz' | |
tar -xzvf ${GEOIP_OUTPUT_DIR}/geoip.city.tar.gz --directory ${GEOIP_OUTPUT_DIR} --strip-components 1 | |
# Build and run the tests | |
- name: '[POSIX] Build & test Agora' | |
if: runner.os != 'Windows' | |
#continue-on-error: ${{ matrix.dc == 'ldc-master' }} | |
run: ./ci/run.sh | |
- name: '[Windows] Build & test Agora' | |
if: runner.os == 'Windows' | |
env: | |
LIB: ${{ github.workspace }}\lib\libsodium\x64\Release\v142\static\;${{ github.workspace }}\submodules\d2sqlite3\lib\win64\;$LIB | |
INCLUDE: ${{ github.workspace }}\lib\libsodium\include\;$INCLUDE | |
#continue-on-error: matrix.dc == 'ldc-master' | |
shell: cmd | |
run: | | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
call ci\run.bat | |
- name: Test example configuration file | |
if: matrix.run_extra_checks && runner.os != 'Windows' | |
run: | | |
./build/agora -c doc/config.example.yaml --config-check | |
./build/agora -c devel/config-single.yaml --config-check | |
./build/agora -c devel/testnet/config.yaml --config-check | |
- name: Check vtable offset | |
if: matrix.run_extra_checks && runner.os != 'Windows' | |
env: | |
AGORA_VERSION: HEAD | |
run: ci/check_vtable_test.d | |
- name: 'Upload code coverage' | |
uses: codecov/codecov-action@v1 | |
with: | |
flags: unittests | |
# Finally, upload the artifacts | |
# | |
# For push event, we need to select which compiler to use | |
# This is defined in the build matrix so the condition here | |
# doesn't have to be edited. | |
# | |
# We used to upload artifacts for all pull request events as well, | |
# but it provide to be too flakey and would often lead to spurious | |
# failures. See https://github.com/bosagora/agora/issues/882 | |
- name: 'Upload build artifacts' | |
if: github.event_name == 'push' && matrix.artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: agora-${{ matrix.os }} | |
path: build/ |