-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3923 from weiznich/ci/m1_runners
Try out M1 Runners
- Loading branch information
Showing
18 changed files
with
156 additions
and
87 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,18 +27,15 @@ jobs: | |
matrix: | ||
rust: ["stable", "beta", "nightly"] | ||
backend: ["postgres", "sqlite", "mysql"] | ||
os: [ubuntu-latest, macos-latest, windows-2019] | ||
os: [ubuntu-latest, macos-latest, macos-14, windows-2019] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ runner.os }}-${{ matrix.backend }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
|
||
- name: Set environment variables | ||
|
@@ -121,14 +118,23 @@ jobs: | |
echo "MYSQL_UNIT_TEST_DATABASE_URL=mysql://root:root@localhost/diesel_unit_test" >> $GITHUB_ENV | ||
- name: Install postgres (MacOS) | ||
if: runner.os == 'macOS' && matrix.backend == 'postgres' | ||
if: matrix.os == 'macos-latest' && matrix.backend == 'postgres' | ||
run: | | ||
initdb -D /usr/local/var/postgres | ||
pg_ctl -D /usr/local/var/postgres start | ||
sleep 3 | ||
createuser -s postgres | ||
echo "PG_DATABASE_URL=postgres://postgres@localhost/" >> $GITHUB_ENV | ||
echo "PG_EXAMPLE_DATABASE_URL=postgres://postgres@localhost/diesel_example" >> $GITHUB_ENV | ||
- name: Install postgres (MacOS M1) | ||
if: matrix.os == 'macos-14' && matrix.backend == 'postgres' | ||
run: | | ||
brew install postgresql | ||
brew services start postgresql@14 | ||
sleep 3 | ||
createuser -s postgres | ||
echo "PG_DATABASE_URL=postgres://postgres@localhost/" >> $GITHUB_ENV | ||
echo "PG_EXAMPLE_DATABASE_URL=postgres://postgres@localhost/diesel_example" >> $GITHUB_ENV | ||
- name: Install sqlite (MacOS) | ||
if: runner.os == 'macOS' && matrix.backend == 'sqlite' | ||
|
@@ -137,7 +143,7 @@ jobs: | |
echo "SQLITE_DATABASE_URL=/tmp/test.db" >> $GITHUB_ENV | ||
- name: Install mysql (MacOS) | ||
if: runner.os == 'macOS' && matrix.backend == 'mysql' | ||
if: matrix.os == 'macos-latest' && matrix.backend == 'mysql' | ||
run: | | ||
brew install [email protected] | ||
/usr/local/opt/[email protected]/bin/mysql_install_db | ||
|
@@ -149,6 +155,20 @@ jobs: | |
echo "MYSQL_UNIT_TEST_DATABASE_URL=mysql://runner@localhost/diesel_unit_test" >> $GITHUB_ENV | ||
echo "MYSQLCLIENT_LIB_DIR=/usr/local/opt/[email protected]/lib" >> $GITHUB_ENV | ||
- name: Install mysql (MacOS M1) | ||
if: matrix.os == 'macos-14' && matrix.backend == 'mysql' | ||
run: | | ||
brew install [email protected] | ||
ls /opt/homebrew/opt/[email protected] | ||
/opt/homebrew/opt/[email protected]/bin/mysql_install_db | ||
/opt/homebrew/opt/[email protected]/bin/mysql.server start | ||
sleep 3 | ||
/opt/homebrew/opt/[email protected]/bin/mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'runner'@'localhost';" -urunner | ||
echo "MYSQL_DATABASE_URL=mysql://runner@localhost/diesel_test" >> $GITHUB_ENV | ||
echo "MYSQL_EXAMPLE_DATABASE_URL=mysql://runner@localhost/diesel_example" >> $GITHUB_ENV | ||
echo "MYSQL_UNIT_TEST_DATABASE_URL=mysql://runner@localhost/diesel_unit_test" >> $GITHUB_ENV | ||
echo "MYSQLCLIENT_LIB_DIR=/opt/homebrew/opt/[email protected]/lib" >> $GITHUB_ENV | ||
- name: Install sqlite (Windows) | ||
if: runner.os == 'Windows' && matrix.backend == 'sqlite' | ||
shell: cmd | ||
|
@@ -300,16 +320,13 @@ jobs: | |
name: Compiletests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2023-09-21 | ||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: compile_test-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
|
@@ -325,16 +342,13 @@ jobs: | |
name: Check rustfmt style && run clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy, rustfmt | ||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: clippy-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
|
||
- name: Install dependencies | ||
|
@@ -405,16 +419,13 @@ jobs: | |
name: Check sqlite bundled + Sqlite with asan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: "rust-src" | ||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: sqlite_bundled-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
|
||
- name: Test diesel-cli | ||
|
@@ -437,17 +448,14 @@ jobs: | |
name: Check Minimal supported rust version (1.70.0) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/[email protected] | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- uses: taiki-e/install-action@cargo-hack | ||
- uses: taiki-e/install-action@cargo-minimal-versions | ||
- name: Cache cargo registry | ||
uses: actions/cache@v3 | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: minimal_rust_version-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
- name: Install dependencies | ||
run: | | ||
|
@@ -471,7 +479,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout Actions Repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check the spelling of the files in our repo | ||
uses: crate-ci/typos@master |
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
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
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
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
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
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
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
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
Oops, something went wrong.