Skip to content

Commit

Permalink
consolidate CI even more
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Oct 31, 2022
1 parent 229a04e commit e90ad4f
Showing 1 changed file with 25 additions and 39 deletions.
64 changes: 25 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,6 @@ on:
workflow_dispatch:

jobs:
test:
name: Run format and clippy tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Start postgres
uses: nyurik/action-setup-postgis@v1
id: pg
with:
username: test
password: test
database: test
rights: --superuser
- name: Test
run: |
tests/fixtures/initdb.sh
cargo test --all
tests/test.sh
env:
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}
- name: Compare test output results (TODO)
if: false
run: |
# TODO: this test is currently broken because the output of the tests is not deterministic
diff --brief --recursive --new-file tests/output tests/expected
- name: 'Save test output on failure'
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-output
path: tests/output/*
retention-days: 5

build:
strategy:
fail-fast: true
Expand All @@ -69,6 +31,12 @@ jobs:
# target: ${{ matrix.target }}
- name: Checkout
uses: actions/checkout@v3
- name: Lint
if: runner.os == 'Linux'
shell: bash
run: |
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
- name: Install OpenSSL (Windows)
if: runner.os == 'Windows'
run: |
Expand All @@ -84,7 +52,6 @@ jobs:
else
mv target/${{ matrix.target }}/release/martin target_releases
fi
- name: 'Save build artifacts'
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -123,6 +90,25 @@ jobs:
password: test
database: test
rights: --superuser
- name: Unit Tests (Linux)
if: runner.os == 'Linux'
shell: bash
run: cargo test --all
env:
DATABASE_URL: ${{ steps.pg.outputs.connection-uri }}
- name: Compare test output results (TODO)
if: false && runner.os == 'Linux'
run: |
# TODO: this test is currently broken
# the output of the tests is not deterministic
diff --brief --recursive --new-file tests/output tests/expected
- name: 'Save test output on failure (Linux)'
if: failure() && runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: test-output
path: tests/output/*
retention-days: 5
- name: Test
shell: bash
run: |
Expand Down

0 comments on commit e90ad4f

Please sign in to comment.