Skip to content

Merge pull request #602 from data-preservation-programs/feat/delete-p… #98

Merge pull request #602 from data-preservation-programs/feat/delete-p…

Merge pull request #602 from data-preservation-programs/feat/delete-p… #98

name: CI (Podman Devcontainer)
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
permissions:
contents: read
checks: write
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true
jobs:
devcontainer-checks:
name: Devcontainer CI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Podman as Docker
uses: parkan/github-actions/setup-podman-docker@v2
with:
disable-docker: true
cache-storage: false # Disabled until cache issues resolved
- name: Build devcontainer
id: build
uses: parkan/github-actions/devcontainer-build@v2
with:
workspace-folder: .
container-runtime: podman
container-id-label: ci=podman
# Fast surface checks and codegen first
- name: Generate swagger code
uses: parkan/github-actions/devcontainer-exec@v2
with:
container-id: ${{ steps.build.outputs.container-id }}
command: 'cd /workspaces/singularity && mkdir -p client/swagger/client && go install github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5 && go generate ./client/swagger/...'
container-runtime: podman
- name: Check formatting
uses: parkan/github-actions/devcontainer-exec@v2
with:
container-id: ${{ steps.build.outputs.container-id }}
command: 'cd /workspaces/singularity && gofmt -l .'
container-runtime: podman
- name: Run go vet
uses: parkan/github-actions/devcontainer-exec@v2
with:
container-id: ${{ steps.build.outputs.container-id }}
command: 'cd /workspaces/singularity && go vet ./...'
container-runtime: podman
- name: Run staticcheck
uses: parkan/github-actions/devcontainer-exec@v2
with:
container-id: ${{ steps.build.outputs.container-id }}
command: 'cd /workspaces/singularity && staticcheck ./...'
container-runtime: podman
- name: Build binary
uses: parkan/github-actions/devcontainer-exec@v2
with:
container-id: ${{ steps.build.outputs.container-id }}
command: 'cd /workspaces/singularity && go build -o singularity .'
container-runtime: podman
- name: Run tests
uses: parkan/github-actions/devcontainer-exec@v2
with:
container-id: ${{ steps.build.outputs.container-id }}
command: >
cd /workspaces/singularity && mkdir -p artifacts && make test GOTESTSUM_ARGS="--junitfile artifacts/unit-tests.xml"
container-runtime: podman
- name: Run integration tests
uses: parkan/github-actions/devcontainer-exec@v2
with:
container-id: ${{ steps.build.outputs.container-id }}
command: >
cd /workspaces/singularity &&
mkdir -p artifacts &&
SINGULARITY_TEST_INTEGRATION=true make test GOTESTSUM_ARGS="--junitfile artifacts/integration-tests.xml -- -timeout 20m -run Integration ./cmd/..."
container-runtime: podman
- name: Report test results
if: always()
uses: dorny/test-reporter@v2
with:
name: Go tests
path: artifacts/*.xml
reporter: java-junit
list-tests: failed
use-actions-summary: true
fail-on-error: false
- name: Cleanup
if: always()
uses: parkan/github-actions/devcontainer-cleanup@v2
with:
container-id: ${{ steps.build.outputs.container-id }}
container-runtime: podman