Update installation.md #272
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: Run tests | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
branches: | |
- master | |
- develop | |
env: | |
AWS_DEFAULT_REGION: ap-southeast-2 | |
jobs: | |
tests: | |
name: tests | |
runs-on: ${{ matrix.os }} | |
if: "!contains(github.event.head_commit.message, 'nogha') && !contains(github.event.head_commit.message, 'notests')" | |
strategy: | |
matrix: | |
os: ["ubuntu-20.04"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Init runner | |
run: .github/workflows/scripts/runner-init.sh | |
- name: Cache build image | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: image-build.tgz | |
key: ansilo-build-${{ runner.os }}-${{ hashFiles('.github/workflows/docker/build.ubi9.Dockerfile', '.github/workflows/scripts/build-build-image.sh') }} | |
- name: Cache maven registry | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
~/.m2 | |
key: ansilo-test-package-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} | |
- name: Build base image | |
run: .github/workflows/scripts/build-build-image.sh | |
- uses: Swatinem/rust-cache@v2 | |
- name: Create volume dirs | |
run: .github/workflows/scripts/volumes.sh | |
- name: Cargo build | |
run: | | |
docker run \ | |
-v $HOME/.cargo:/home/build/.cargo \ | |
-v $HOME/.m2:/home/build/.m2 \ | |
-v $HOME/.ecs:/home/build/.ecs \ | |
-v $HOME/.pgx:/home/build/.pgx \ | |
-v $PWD:/build/ \ | |
-w /build/ \ | |
ansilo-build /build/.github/workflows/scripts/test-build.sh | |
- name: Test setup | |
run: | | |
docker run \ | |
-e AWS_ACCESS_KEY_ID=${{ secrets.TESTS_AWS_ACCESS_KEY_ID }} \ | |
-e AWS_SECRET_ACCESS_KEY=${{ secrets.TESTS_AWS_SECRET_ACCESS_KEY }} \ | |
-e GHA_RUN_ID=${{ github.run_id }} \ | |
-v $HOME/.cargo:/home/build/.cargo \ | |
-v $HOME/.m2:/home/build/.m2 \ | |
-v $HOME/.ecs:/home/build/.ecs \ | |
-v $HOME/.pgx:/home/build/.pgx \ | |
-v $PWD:/build/ \ | |
-w /build/ \ | |
ansilo-build /build/.github/workflows/scripts/test-setup.sh | |
- name: Run tests | |
run: | | |
docker run \ | |
-e AWS_ACCESS_KEY_ID=${{ secrets.TESTS_AWS_ACCESS_KEY_ID }} \ | |
-e AWS_SECRET_ACCESS_KEY=${{ secrets.TESTS_AWS_SECRET_ACCESS_KEY }} \ | |
-e GHA_RUN_ID=${{ github.run_id }} \ | |
-v $HOME/.cargo:/home/build/.cargo \ | |
-v $HOME/.m2:/home/build/.m2 \ | |
-v $HOME/.ecs:/home/build/.ecs \ | |
-v $HOME/.pgx:/home/build/.pgx \ | |
-v $PWD:/build/ \ | |
-w /build/ \ | |
ansilo-build /build/.github/workflows/scripts/test.sh | |
- name: Post tests teardown | |
if: always() | |
run: | | |
docker run \ | |
-e AWS_ACCESS_KEY_ID=${{ secrets.TESTS_AWS_ACCESS_KEY_ID }} \ | |
-e AWS_SECRET_ACCESS_KEY=${{ secrets.TESTS_AWS_SECRET_ACCESS_KEY }} \ | |
-e GHA_RUN_ID=${{ github.run_id }} \ | |
-v $HOME/.cargo:/home/build/.cargo \ | |
-v $HOME/.m2:/home/build/.m2 \ | |
-v $HOME/.ecs:/home/build/.ecs \ | |
-v $HOME/.pgx:/home/build/.pgx \ | |
-v $PWD:/build/ \ | |
-w /build/ \ | |
ansilo-build /build/.github/workflows/scripts/test-teardown.sh |