ci: Add alpine-based Dockerfile for integration-testing package scripts #35
Workflow file for this run
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-Docker | |
on: [push, pull_request] | |
permissions: | |
contents: read | |
jobs: | |
test-dev-alpine: | |
name: test-dev-alpine | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1 # v2 | |
with: | |
driver: docker-container | |
driver-opts: | | |
image=docker.io/moby/buildkit:master@sha256:1b6abfd9bbfbf129245dc1f288aa38f064dfee8d608b8be9086936f5580c78f2 | |
- name: Build OCI image | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 #v5 | |
with: | |
cache-from: type=${{ env.ACT && 'local,src=/tmp/act-cache' || 'gha' }} | |
cache-to: type=${{ env.ACT && 'local,dest=/tmp/act-cache' || 'gha' }},mode=max | |
context: . | |
file: test/integration/Dockerfile-alpine | |
load: true | |
push: false | |
tags: dev:latest | |
- name: lint | |
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3 | |
with: | |
image: dev:latest | |
run: 'npm run lint && npm run lint:fix' | |
- name: publish-dry-run | |
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3 | |
with: | |
image: dev:latest | |
run: | | |
# note: package scripts only seem to support maximum a single unpublished package present in the repository | |
export npm_config_newpkg=$(jq 'to_entries|map(select(.value=="0.0.0"))[0]' -r .release-please-manifest.json) | |
echo "New package: ${npm_config_newpkg}" | |
npm run release:dry-run | |
npm run release:publish | |
- name: rebuild | |
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3 | |
with: | |
image: dev:latest | |
run: npm run setup && npm run rebuild | |
- name: lint:git | |
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3 | |
with: | |
image: dev:latest | |
run: > | |
git init -b main && | |
git add README.md && npm run lint:staged && | |
git commit -m 'docs: Add README.md' && npm run lint:commit -- -e | |
- name: test | |
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3 | |
with: | |
image: dev:latest | |
run: npm run test:prep && npm run test |