Skip to content

Commit 73e7a93

Browse files
authored
feat(ci): Split tests in CI in partial and full (#311)
1 parent 831fd35 commit 73e7a93

File tree

1 file changed

+51
-3
lines changed

1 file changed

+51
-3
lines changed

.github/workflows/ci.yml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,57 @@ jobs:
4242
if: matrix.check == 'clippy'
4343
run: cargo clippy --all-targets --all-features --no-deps -- -D warnings
4444

45-
test:
46-
name: Test
45+
test-partial:
46+
name: Test Partial
4747
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
4896
permissions:
4997
contents: read
5098
id-token: write
@@ -58,7 +106,7 @@ jobs:
58106
- name: Setup Rust cache
59107
uses: Swatinem/rust-cache@v2
60108
with:
61-
key: test
109+
key: test-full
62110

63111
- name: Start Docker Compose Environment
64112
run: |

0 commit comments

Comments
 (0)