fix: get rust tests passing for daily and startEnd when evaluated aga… #146
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
name: Test | |
on: | |
push: | |
branches: | |
- "*" | |
paths-ignore: | |
- "**.md" | |
jobs: | |
publish-test-server: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: "./packages/test-server" | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: vexilla | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: Build Test Server Image | |
run: | | |
docker build . --tag ghcr.io/vexilla/test-server:latest | |
docker push ghcr.io/vexilla/test-server:latest | |
test-php: | |
runs-on: ubuntu-latest | |
container: php:7.4.33-fpm | |
needs: ["publish-test-server"] | |
services: | |
test-server: | |
credentials: | |
username: vexilla | |
password: ${{secrets.GITHUB_TOKEN}} | |
image: ghcr.io/vexilla/test-server:latest | |
ports: | |
- 3000:3000 | |
options: | | |
--health-cmd "curl -f http://localhost:3000/manifest.json" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/composer-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
- name: Install Composer | |
run: | | |
apt-get update | |
apt-get install git unzip -y | |
pecl install pcov | |
cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini | |
echo "extension=pcov.so\n" >> /usr/local/etc/php/php.ini | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
# php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
php composer-setup.php --install-dir=/usr/local/bin --filename=composer | |
php -r "unlink('composer-setup.php');" | |
- run: | | |
cd ./clients/php | |
composer install | |
composer test | |
env: | |
TEST_SERVER_HOST: test-server:3000 | |
test-python: | |
runs-on: ubuntu-latest | |
container: python:3.6.15 | |
needs: ["publish-test-server"] | |
services: | |
test-server: | |
credentials: | |
username: vexilla | |
password: ${{secrets.GITHUB_TOKEN}} | |
image: ghcr.io/vexilla/test-server:latest | |
ports: | |
- 3000:3000 | |
options: | | |
--health-cmd "curl -f http://localhost:3000/manifest.json" | |
steps: | |
- uses: actions/checkout@v3 | |
- run: pip3 install pipenv | |
- run: | | |
cd ./clients/python | |
pipenv install | |
pipenv run pytest --cov=vexilla_client | |
env: | |
TEST_SERVER_HOST: test-server:3000 | |
test-elixir: | |
runs-on: ubuntu-latest | |
container: elixir:1.15.7 | |
needs: ["publish-test-server"] | |
services: | |
test-server: | |
credentials: | |
username: vexilla | |
password: ${{secrets.GITHUB_TOKEN}} | |
image: ghcr.io/vexilla/test-server:latest | |
ports: | |
- 3000:3000 | |
options: | | |
--health-cmd "curl -f http://localhost:3000/manifest.json" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Mix dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
/clients/elixir/_build | |
/clients/elixir/deps | |
key: ${{ runner.os }}-${{ hashFiles('clients/elixir/mix.lock') }} | |
- run: | | |
cd ./clients/elixir | |
mix deps.get | |
mix local.hex --force | |
mix test --cover --export-coverage default | |
mix test.coverage | |
env: | |
TEST_SERVER_HOST: test-server:3000 | |
test-bazel: | |
runs-on: ubuntu-latest | |
needs: ["publish-test-server"] | |
services: | |
test-server: | |
credentials: | |
username: vexilla | |
password: ${{secrets.GITHUB_TOKEN}} | |
image: ghcr.io/vexilla/test-server:latest | |
ports: | |
- 3000:3000 | |
options: | | |
--health-cmd "curl -f http://localhost:3000/manifest.json" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cache Bazel | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/bazel | |
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel') }} | |
restore-keys: | | |
${{ runner.os }}-bazel- | |
- run: bazel build //... | |
- run: bazel coverage --combined_report=lcov //... | |
# - run: bazel test //... | |
env: | |
TEST_SERVER_HOST: test-server | |
test-kotlin: | |
runs-on: ubuntu-latest | |
needs: ["publish-test-server"] | |
services: | |
test-server: | |
credentials: | |
username: vexilla | |
password: ${{secrets.GITHUB_TOKEN}} | |
image: ghcr.io/vexilla/test-server:latest | |
ports: | |
- 3000:3000 | |
options: | | |
--health-cmd "curl -f http://localhost:3000/manifest.json" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: corretto | |
java-version: 8 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Execute Gradle build and then test | |
run: | | |
cd clients/kotlin | |
./gradlew build | |
./gradlew test | |
# test-server not available on local network | |
# env: | |
# TEST_SERVER_HOST: test-server |