Skip to content

Commit

Permalink
feat: add test and release stages to GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andrielfn committed Sep 21, 2024
1 parent 3f20937 commit 72e574e
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/build-deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,49 +27,49 @@ jobs:
name: postgresql-ulid-deb
path: ./*.deb

# test:
# name: Test
# needs: build
# runs-on: ubuntu-22.04
# steps:
# - name: Download package
# uses: actions/download-artifact@v3
# with:
# name: postgresql-ulid-deb
# - name: Install PostgreSQL 16
# run: |
# sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
# curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
# sudo apt-get update
# sudo apt-get install -y postgresql-16 postgresql-contrib-16
# - name: Start PostgreSQL service
# run: |
# sudo systemctl start postgresql
# sudo systemctl status postgresql
# - name: Install package
# run: |
# sudo dpkg -i *.deb
# sudo apt-get install -f
# - name: Test PostgreSQL extension
# run: |
# sudo -u postgres psql -c "CREATE EXTENSION ulid;"
# sudo -u postgres psql -c "SELECT gen_ulid();"
# sudo -u postgres psql -c "SELECT '01H55TNAQ96WPSWE6WZRCH9G0C'::ulid::timestamp;"
test:
name: Test
needs: build
runs-on: ubuntu-22.04
steps:
- name: Download package
uses: actions/download-artifact@v3
with:
name: postgresql-ulid-deb
- name: Install PostgreSQL 16
run: |
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg
sudo apt-get update
sudo apt-get install -y postgresql-16 postgresql-contrib-16
- name: Start PostgreSQL service
run: |
sudo systemctl start postgresql
sudo systemctl status postgresql
- name: Install package
run: |
sudo dpkg -i *.deb
sudo apt-get install -f
- name: Test PostgreSQL extension
run: |
sudo -u postgres psql -c "CREATE EXTENSION ulid;"
sudo -u postgres psql -c "SELECT gen_ulid();"
sudo -u postgres psql -c "SELECT '01H55TNAQ96WPSWE6WZRCH9G0C'::ulid::timestamp;"
# release:
# name: Create Release
# needs: [build, test]
# runs-on: ubuntu-22.04
# steps:
# - name: Download package
# uses: actions/download-artifact@v3
# with:
# name: postgresql-ulid-deb
# - name: Create Release
# uses: ncipollo/release-action@v1
# with:
# artifacts: "postgresql-ulid_${{ env.VERSION }}_amd64.deb"
# name: Release ${{ env.VERSION }}
# tag: ${{ env.VERSION }}
# draft: false
# prerelease: false
release:
name: Create Release
needs: [build, test]
runs-on: ubuntu-22.04
steps:
- name: Download package
uses: actions/download-artifact@v3
with:
name: postgresql-ulid-deb
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "postgresql-ulid_${{ env.VERSION }}_amd64.deb"
name: Release ${{ env.VERSION }}
tag: ${{ env.VERSION }}
draft: false
prerelease: false

0 comments on commit 72e574e

Please sign in to comment.