build(deps): bump softprops/action-gh-release from 2 to 3 in the all-… #74
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: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| MISE_LOG_LEVEL: debug | |
| jobs: | |
| setup: | |
| name: Load versions | |
| runs-on: ubuntu-latest | |
| outputs: | |
| oldest_version: ${{ steps.versions.outputs.oldest_version }} | |
| pg_versions: ${{ steps.versions.outputs.pg_versions }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Load PostgreSQL versions from scripts/postgres-versions.json | |
| id: versions | |
| run: | | |
| newest=$(jq -r '.newest' scripts/postgres-versions.json) | |
| oldest=$(jq -r '.oldest' scripts/postgres-versions.json) | |
| echo "oldest_version=$oldest" >> "$GITHUB_OUTPUT" | |
| echo "pg_versions=[\"$newest\", \"$oldest\"]" >> "$GITHUB_OUTPUT" | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Lua and LuaRocks | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y lua5.4 liblua5.4-dev luarocks | |
| - uses: actions/cache@v5 | |
| with: | |
| path: .luarocks | |
| key: luarocks-${{ runner.os }}-${{ hashFiles('mise.toml') }} | |
| restore-keys: | | |
| luarocks-${{ runner.os }}- | |
| - uses: jdx/mise-action@v4 | |
| with: | |
| experimental: true | |
| cache: true | |
| - name: Run linters | |
| run: mise run lint | |
| - name: Run unit tests | |
| run: mise run test | |
| test: | |
| name: Test (${{ matrix.os }}, PG ${{ matrix.pg_version }}) | |
| needs: [lint, setup] | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| pg_version: ${{ fromJson(needs.setup.outputs.pg_versions) }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-mise-plugin | |
| - name: List available versions | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: mise ls-remote postgres-binary:postgres | head -10 | |
| - name: Install PostgreSQL ${{ matrix.pg_version }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: mise install postgres-binary:postgres@${{ matrix.pg_version }} | |
| - name: Verify binaries | |
| run: | | |
| mise exec postgres-binary:postgres@${{ matrix.pg_version }} -- postgres --version | |
| mise exec postgres-binary:postgres@${{ matrix.pg_version }} -- psql --version | |
| mise exec postgres-binary:postgres@${{ matrix.pg_version }} -- pg_dump --version | |
| mise exec postgres-binary:postgres@${{ matrix.pg_version }} -- pg_restore --version | |
| mise exec postgres-binary:postgres@${{ matrix.pg_version }} -- initdb --version | |
| - name: Check environment setup | |
| run: | | |
| eval "$(mise activate bash)" | |
| mise use postgres-binary:postgres@${{ matrix.pg_version }} | |
| eval "$(mise activate bash)" | |
| echo "PGDATA=$PGDATA" | |
| echo "PGHOME=$PGHOME" | |
| [ -d "$PGDATA" ] && echo "PGDATA directory exists" || exit 1 | |
| [ -f "$PGDATA/PG_VERSION" ] && echo "Database initialized" || exit 1 | |
| - name: Start PostgreSQL and run query | |
| run: | | |
| eval "$(mise activate bash)" | |
| mise use postgres-binary:postgres@${{ matrix.pg_version }} | |
| eval "$(mise activate bash)" | |
| pg_ctl start -D "$PGDATA" -l /tmp/pg.log -w | |
| psql -c "SELECT version();" postgres | |
| psql -c "CREATE TABLE test_table (id SERIAL PRIMARY KEY, name TEXT);" postgres | |
| psql -c "INSERT INTO test_table (name) VALUES ('mise-postgres-binary');" postgres | |
| psql -c "SELECT * FROM test_table;" postgres | |
| pg_ctl stop -D "$PGDATA" -m fast | |
| test-docker: | |
| name: Test Docker (${{ matrix.target }}) | |
| needs: lint | |
| timeout-minutes: 20 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [debian-pg14, alpine-pg14] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build ${{ matrix.target }} | |
| uses: docker/bake-action@v7 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| files: docker/docker-bake.hcl | |
| targets: ${{ matrix.target }} | |
| load: true | |
| - name: Test ${{ matrix.target }} | |
| run: docker run --rm mise-postgres-${{ matrix.target }} | |
| test-windows: | |
| name: Test (Windows) | |
| needs: [lint, setup] | |
| timeout-minutes: 30 | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/setup-mise-plugin | |
| - name: List available versions | |
| shell: bash | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: mise ls-remote postgres-binary:postgres | head -10 | |
| - name: Install PostgreSQL | |
| shell: bash | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: mise install postgres-binary:postgres@${{ needs.setup.outputs.oldest_version }} | |
| - name: Verify binaries | |
| shell: bash | |
| run: | | |
| mise exec postgres-binary:postgres@${{ needs.setup.outputs.oldest_version }} -- postgres --version | |
| mise exec postgres-binary:postgres@${{ needs.setup.outputs.oldest_version }} -- psql --version |