Skip to content

chore: forgot tests exist #83

chore: forgot tests exist

chore: forgot tests exist #83

Workflow file for this run

name: Docker Image CI
on:
push:
tags:
- v*
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
runs-on: ubuntu-latest
services:
testdb:
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: chmod +x bin/* && sed -i "s/\r$//g" bin/* && sed -i 's/ruby\.exe$/ruby/' bin/*
- name: "Create test database"
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: >-
bin/rake parallel:create
&& bin/rake parallel:migrate
&& bin/rake parallel:prepare
- name: "Run tests"
env:
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: bin/rake parallel:test
generate-vi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate mk2.vi
run: sh ./mkvi.sh
shell: sh
- name: Upload vi artifact
uses: actions/upload-artifact@v4
with:
name: mk2.vi
path: mk2.vi
overwrite: true
build-push-debian:
needs:
- generate-vi
- test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Download vi
uses: actions/download-artifact@v4
with:
name: mk2.vi
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image (MRI)
id: push-mri
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation (MRI)
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push-mri.outputs.digest }}
push-to-registry: true
# build-push-alpine:
# needs:
# - generate-vi
# - test
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# attestations: write
# id-token: write
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Download vi
# uses: actions/download-artifact@v4
# with:
# name: mk2.vi
#
# - name: Log in to the Container registry
# uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Extract metadata (tags, labels) for Docker
# id: meta-alpine
# uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
# with:
# flavor: |
# latest=true
# suffix=-alpine
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
#
# - name: Build and push Docker image (MRI)
# id: push-mri-alpine
# uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
# with:
# context: .
# file: ./Containerfile
# push: true
# tags: ${{ steps.meta-alpine.outputs.tags }}
# labels: ${{ steps.meta-alpine.outputs.labels }}
#
# - name: Generate artifact attestation (MRI)
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
# subject-digest: ${{ steps.push-mri-alpine.outputs.digest }}
# push-to-registry: true