test TLS for MySQL on CI
@@ -25,9 +25,14 @@ jobs:
# will assign a random free host port
- 3306/tcp
# needed because the container does not provide a healthcheck
- options: --health-cmd "mysqladmin ping --silent" --health-interval 30s --health-timeout 30s --health-retries 10
+ options: >-
+ --health-cmd "mysqladmin ping --silent" --health-interval 30s --health-timeout 30s
+ --health-retries 10 -v /data/mysql:/var/lib/mysql
+
steps:
+ - run: docker logs ${{ job.services.mysql.id }}
+ - run: ls /data/mysql
- uses: actions/checkout@v1
# Rust ------------------------------------------------
@@ -48,9 +53,11 @@ jobs:
# -----------------------------------------------------
- - run: cargo test -p sqlx --no-default-features --features 'mysql macros chrono'
+ - run: cargo test -p sqlx --no-default-features --features 'mysql macros chrono tls'
env:
- DATABASE_URL: mysql://root:password@localhost:${{ job.services.mysql.ports[3306] }}/sqlx
+ # pass the path to the CA that the MySQL service generated
+ # Github Actions' YML parser doesn't handle multiline strings correctly
+ DATABASE_URL: mysql://root:password@localhost:${{ job.services.mysql.ports[3306] }}/sqlx?ssl-mode=VERIFY_CA&ssl-ca=%2Fdata%2Fmysql%2Fca.pem
# Rust ------------------------------------------------
