Merge pull request #3 from robinportigliatti/main #5
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
name: CI | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
installcheck: | |
runs-on: ubuntu-latest | |
container: | |
image: postgres:latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_DB: testdb | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Prepare PostgreSQL | |
run: | | |
mkdir -p $PGDATA | |
chown postgres $PGDATA | |
su postgres -c "initdb" | |
su postgres -c "pg_ctl start -D $PGDATA" | |
- name: Install dependencies | |
run: | | |
apt update -y | |
apt install -y make | |
- name: Build and run tests | |
run: | | |
make install | |
PGUSER=postgres make installcheck | |
nfpm: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: installcheck | |
steps: | |
- name: Check out the repository to the runner | |
uses: actions/checkout@v4 | |
- name: Create restore_points DEB 17 Package | |
uses: docker://goreleaser/nfpm:latest | |
with: | |
args: package --config=./nfpm/17/deb.yaml --target ./restore_points_17_1.5_amd64.deb | |
- name: Create restore_points RPM 17 Package | |
uses: docker://goreleaser/nfpm:latest | |
with: | |
args: package --config=./nfpm/17/rpm.yaml --target ./restore_points_17_1.5.x86_64.rpm | |
- name: Archive Prometheus Package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: packages | |
path: | | |
*_amd64.deb | |
*.x86_64.rpm | |
retention-days: 30 # Conserve les artefacts pendant 30 jours |