Files
engine/.github/workflows/tests.yml
2021-02-06 16:35:50 +01:00

67 lines
2.4 KiB
YAML

name: tests
on:
push:
branches-ignore: [ main, dev ]
pull_request:
branches-ignore: [ main, dev ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: build engine
run: |
export PATH=$GITHUB_WORKSPACE/bin:$PATH
export RUSTC_WRAPPER=$GITHUB_WORKSPACE/bin/sccache
export SCCACHE_REDIS=${{ secrets.SCCACHE_REDIS }}
mkdir -p $GITHUB_WORKSPACE/bin
sccache_release=$(curl --silent "https://github.com/Qovery/sccache-bin/releases/latest" | sed -r 's/^.+tag\/(.+)">.+/\1/')
curl -sLo $GITHUB_WORKSPACE/bin/sccache https://github.com/Qovery/sccache-bin/releases/download/${sccache_release}/sccache
chmod 755 $GITHUB_WORKSPACE/bin/sccache
echo "########## SHARED CACHE STATUS ##########"
sccache --version
sccache --show-stats
echo "########## START BUILD ##########"
cargo build --release --all-features
sccache --show-stats
selected-functionnal-tests:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
needs: build
steps:
- uses: actions/checkout@v1
- name: Run selected functional tests
timeout-minutes: 120
env:
GITLAB_PROJECT_ID: ${{ secrets.GITLAB_PROJECT_ID }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
GITLAB_PERSONAL_TOKEN: ${{ secrets.GITLAB_PERSONAL_TOKEN }}
run: |
branch=$(echo ${{github.ref}} | sed -r 's/^refs\/heads\/(.+)/\1/')
echo "Branch name: $branch"
export GITHUB_BRANCH=$branch
export GITHUB_COMMIT_ID=$GITHUB_SHA
./helper.sh autodetect
all-tests-enabled:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v1
- name: Only validate PR if all tests have been requested
timeout-minutes: 120
env:
GITLAB_PROJECT_ID: ${{ secrets.GITLAB_PROJECT_ID }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
GITLAB_PERSONAL_TOKEN: ${{ secrets.GITLAB_PERSONAL_TOKEN }}
run: |
branch=$(echo ${{github.ref}} | sed -r 's/^refs\/heads\/(.+)/\1/')
echo "Branch name: $branch"
export GITHUB_BRANCH=$branch
export GITHUB_COMMIT_ID=$GITHUB_SHA
./helper.sh check_gh_tags