This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
79 lines (79 loc) · 2.85 KB
/
build-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Continuous Integration
on:
push:
pull_request:
schedule:
- cron: '42 15 * * *'
jobs:
build:
name: HHVM ${{matrix.hhvm}} - ${{matrix.os}}
strategy:
# Run tests on all OS's and HHVM versions, even if one fails
fail-fast: false
matrix:
os: [ ubuntu ]
hhvm:
- '4.153'
- latest
- nightly
runs-on: ${{matrix.os}}-latest
steps:
- uses: actions/checkout@v2
- name: Install Composer
run: .github/workflows/install-composer.sh --install-dir=${{runner.temp}}
- name: Install HHVM (apt)
if: matrix.os == 'ubuntu'
run: |
set -ex
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y software-properties-common apt-transport-https
sudo apt-key add .github/workflows/hhvm.gpg.key
if [ "${{matrix.hhvm}}" = "nightly" ]; then
sudo add-apt-repository https://dl.hhvm.com/ubuntu
sudo apt-get install -y hhvm-nightly
elif [ "${{matrix.hhvm}}" = "latest" ]; then
sudo add-apt-repository https://dl.hhvm.com/ubuntu
sudo apt-get install -y hhvm
else
DISTRO=$(lsb_release --codename --short)
sudo add-apt-repository \
"deb https://dl.hhvm.com/ubuntu ${DISTRO}-${{matrix.hhvm}} main"
sudo apt-get remove -y hhvm || true
sudo apt-get install -y hhvm
fi
- name: Inspect HHVM and Hack versions
run: |
hhvm --version
hh_client --version
- name: Create branch for version alias
run: git checkout -b CI_current_pull_request
- name: Install project dependencies
run: php ${{runner.temp}}/composer.phar install
- name: Run autoloader
run: bin/hh-autoload
- name: Show autoload map
run: cat vendor/autoload.hack
- name: Typecheck
run: hh_client
- name: Run most tests
run: |
# Work around https://github.com/hhvm/hacktest/issues/103
vendor/bin/hacktest \
$(ls -1 tests/*hack | grep -v Fallback)
- name: Run fallback handler test
run: |
ENABLE_HH_CLIENT_AUTOLOAD=true vendor/bin/hacktest \
tests/FallbackHandlerTest.hack
- name: Test XHP configuration permutations
run: |
# FactParseScanner should work with any combination of enable_xhp_class_modifier
# and disable_xhp_element_mangling
export HHVM_CONFIG_FILE=$(mktemp)
for A in false true; do
for B in false true; do
echo hhvm.hack.lang.enable_xhp_class_modifier=$A > $HHVM_CONFIG_FILE
echo hhvm.hack.lang.disable_xhp_element_mangling=$B >> $HHVM_CONFIG_FILE
vendor/bin/hacktest tests/ScannerTest.hack
done
done