Automatically maintain HELP.md for the CLI #1056
Workflow file for this run
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - actions-* | |
| pull_request: | |
| branches: | |
| - master | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-13 | |
| - windows-latest | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Setup git checkout linefeeds on Windows | |
| if: runner.os == 'Windows' | |
| run: | | |
| git config --system core.autocrlf false | |
| git config --system core.eol lf | |
| - uses: actions/checkout@v4 | |
| # Postgresql setup adapted from Diesel CI | |
| # Disable ssl as server doesn't have a trusted cert | |
| - name: Setup PostgreSQL on Linux | |
| if: runner.os == 'Linux' | |
| run: | | |
| set -ex | |
| sudo apt-get update | |
| sudo apt-get install -y postgresql | |
| sudo sed -i "s/scram-sha-256/trust/" /etc/postgresql/16/main/pg_hba.conf | |
| sudo cat /etc/postgresql/16/main/pg_hba.conf | |
| sudo service postgresql restart && sleep 3 | |
| echo BUTANE_PG_CONNSTR="host=localhost user=postgres sslmode=disable port=5432" >> $GITHUB_ENV | |
| echo "/usr/lib/postgresql/16/bin" >> $GITHUB_PATH | |
| - name: Setup PostgreSQL on MacOS | |
| if: runner.os == 'macOS' | |
| run: | | |
| set -ex | |
| brew install postgresql | |
| initdb -D /usr/local/var/postgres | |
| pg_ctl -D /usr/local/var/postgres start | |
| sleep 3 | |
| createuser -s postgres | |
| echo BUTANE_PG_CONNSTR="host=localhost user=postgres sslmode=disable port=5432" >> $GITHUB_ENV | |
| - name: Install PostgreSQL on Windows | |
| if: runner.os == 'Windows' | |
| run: | | |
| set -ex | |
| choco install postgresql12 --force --params '/Password:root' | |
| echo "C:\Program Files\PostgreSQL\12\bin" >> $GITHUB_PATH | |
| echo "C:\Program Files\PostgreSQL\12\lib" >> $GITHUB_PATH | |
| echo "PQ_LIB_DIR=C:\Program Files\PostgreSQL\12\lib" >> $GITHUB_ENV | |
| echo BUTANE_PG_CONNSTR="host=localhost user=postgres password=root sslmode=disable port=5432" >> $GITHUB_ENV | |
| - name: Install sqlite (Windows) | |
| if: runner.os == 'Windows' | |
| shell: cmd | |
| run: | | |
| choco install sqlite | |
| cd /D C:\ProgramData\chocolatey\lib\SQLite\tools | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| lib /machine:x64 /def:sqlite3.def /out:sqlite3.lib | |
| echo "C:\ProgramData\chocolatey\lib\SQLite\tools" >> $GITHUB_PATH | |
| echo "SQLITE3_LIB_DIR=C:\ProgramData\chocolatey\lib\SQLite\tools" >> $GITHUB_ENV | |
| - name: Add Rust nightly toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| components: rustfmt | |
| - name: Add Rust nightly toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Install tool binaries | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-deny,editorconfig-checker,mise,typos | |
| - name: Install ephemeral-postgres via mise | |
| if: runner.os != 'Windows' | |
| run: | | |
| mise install ephemeral-postgres | |
| echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH | |
| - name: Verify ephemeralpg installation | |
| if: runner.os != 'Windows' | |
| run: which pg_tmp | |
| - name: Run editorconfig-checker | |
| run: editorconfig-checker | |
| - name: Build | |
| run: make build | |
| - name: Lint | |
| run: make lint-ci | |
| - name: Run cargo-deny | |
| run: cargo deny check all | |
| - name: Test Butane test helper with ephemeral-postgres | |
| if: runner.os != 'Windows' | |
| run: cd butane_test_helper && mise exec ephemeral-postgres -- cargo +stable test --all-features | |
| - name: Test Butane test helper without ephemeral-postgres | |
| if: runner.os == 'Windows' | |
| run: cd butane_test_helper && cargo +stable test --all-features | |
| - name: Test Core | |
| run: cd butane_core && cargo +stable test --all-features | |
| - name: Test Codegen | |
| run: cd butane_codegen && cargo +stable test --all-features | |
| - name: Test CLI | |
| run: cd butane_cli && cargo +stable test --all-features | |
| - name: Test | |
| run: cd butane && cargo +stable test --all-features | |
| - name: Check example migrations have been updated | |
| run: | | |
| set -ex | |
| make regenerate-example-migrations | |
| # TODO: This file is created by one of the tests on Windows | |
| rm -f butane_core/sqlite | |
| git add -A | |
| git diff --cached --exit-code | |
| - name: Run tests in examples | |
| run: | | |
| set -ex | |
| cargo +stable test -p example --all-features | |
| cd examples | |
| for dir in *; do | |
| cargo +stable test -p $dir --all-features | |
| done |