|
42 | 42 | if: matrix.check == 'clippy'
|
43 | 43 | run: cargo clippy --all-targets --all-features --no-deps -- -D warnings
|
44 | 44 |
|
45 |
| - test: |
46 |
| - name: Test |
| 45 | + test-partial: |
| 46 | + name: Test Partial |
47 | 47 | runs-on: ubuntu-latest
|
| 48 | + # Run on forks. |
| 49 | + if: github.event.pull_request.head.repo.fork == true |
| 50 | + permissions: |
| 51 | + contents: read |
| 52 | + steps: |
| 53 | + - name: Checkout repository |
| 54 | + uses: actions/checkout@v4 |
| 55 | + |
| 56 | + - name: Install Rust toolchain |
| 57 | + uses: dtolnay/rust-toolchain@stable |
| 58 | + |
| 59 | + - name: Setup Rust cache |
| 60 | + uses: Swatinem/rust-cache@v2 |
| 61 | + with: |
| 62 | + key: test-partial |
| 63 | + |
| 64 | + - name: Start Docker Compose Environment |
| 65 | + run: | |
| 66 | + docker compose -f ./scripts/docker-compose.yaml up -d |
| 67 | +
|
| 68 | + - name: Install sqlx-cli |
| 69 | + run: | |
| 70 | + cargo install sqlx-cli \ |
| 71 | + --features native-tls,postgres \ |
| 72 | + --no-default-features \ |
| 73 | + --locked |
| 74 | +
|
| 75 | + - name: Migrate database |
| 76 | + env: |
| 77 | + POSTGRES_USER: postgres |
| 78 | + POSTGRES_PASSWORD: postgres |
| 79 | + POSTGRES_DB: postgres |
| 80 | + POSTGRES_PORT: 5430 |
| 81 | + POSTGRES_HOST: localhost |
| 82 | + run: | |
| 83 | + sudo apt-get install libpq-dev -y |
| 84 | + ./etl-api/scripts/run_migrations.sh |
| 85 | +
|
| 86 | + - name: Run tests |
| 87 | + run: | |
| 88 | + cargo test --workspace --no-fail-fast \ |
| 89 | + --all-features -- --skip integration::bigquery_test |
| 90 | +
|
| 91 | + test-full: |
| 92 | + name: Test Full |
| 93 | + runs-on: ubuntu-latest |
| 94 | + # Run on non forks. |
| 95 | + if: github.event.pull_request.head.repo.fork == false |
48 | 96 | permissions:
|
49 | 97 | contents: read
|
50 | 98 | id-token: write
|
|
58 | 106 | - name: Setup Rust cache
|
59 | 107 | uses: Swatinem/rust-cache@v2
|
60 | 108 | with:
|
61 |
| - key: test |
| 109 | + key: test-full |
62 | 110 |
|
63 | 111 | - name: Start Docker Compose Environment
|
64 | 112 | run: |
|
|
0 commit comments