mirror of
https://github.com/fluencelabs/node-distro
synced 2025-04-25 07:22:14 +00:00
chore: Add distro to e2e (#147)
* Update snapshot build * Fix * Fix * Fix * Add fluence-cli to tests * Fix * Debug * fix * Use debug branch * Fix * Use main
This commit is contained in:
parent
eac20b6acc
commit
c7a0b75aa6
48
.github/workflows/container.yml
vendored
48
.github/workflows/container.yml
vendored
@ -10,23 +10,24 @@ on:
|
|||||||
version:
|
version:
|
||||||
description: "version set as part of container tag"
|
description: "version set as part of container tag"
|
||||||
type: string
|
type: string
|
||||||
|
flavour:
|
||||||
|
description: "nox flavour"
|
||||||
|
type: string
|
||||||
|
default: "minimal"
|
||||||
release:
|
release:
|
||||||
description: "if triggered by release workflow"
|
description: "if triggered by release workflow"
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
outputs:
|
||||||
|
nox-image:
|
||||||
|
description: "nox snapshot image"
|
||||||
|
value: ${{ jobs.build.outputs.image }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: "Build and push ${{ matrix.package }}"
|
name: "Build and push ${{ inputs.flavour }}"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
package:
|
|
||||||
- minimal
|
|
||||||
- ipfs
|
|
||||||
- rich
|
|
||||||
|
|
||||||
# for authentication to Vault with vault-action
|
# for authentication to Vault with vault-action
|
||||||
# https://github.com/hashicorp/vault-action#jwt-with-github-oidc-tokens
|
# https://github.com/hashicorp/vault-action#jwt-with-github-oidc-tokens
|
||||||
permissions:
|
permissions:
|
||||||
@ -36,6 +37,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
RELEASE_VERSION: ${{ inputs.version }}
|
RELEASE_VERSION: ${{ inputs.version }}
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
image: "${{ inputs.image }}@${{ steps.docker.outputs.digest }}"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set build date
|
- name: Set build date
|
||||||
run: echo "BUILD_DATE=$(date '+%Y-%m-%dT%H:%M:%S%:z')" >> $GITHUB_ENV
|
run: echo "BUILD_DATE=$(date '+%Y-%m-%dT%H:%M:%S%:z')" >> $GITHUB_ENV
|
||||||
@ -89,16 +93,16 @@ jobs:
|
|||||||
username: ${{ env.DOCKER_USERNAME }}
|
username: ${{ env.DOCKER_USERNAME }}
|
||||||
password: ${{ env.DOCKER_PASSWORD }}
|
password: ${{ env.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and push ${{ matrix.package }}
|
- name: Build and push ${{ inputs.flavour }}
|
||||||
id: docker
|
id: docker
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
target: ${{ matrix.package }}
|
target: ${{ inputs.flavour }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ inputs.image }}:${{ matrix.package }}
|
${{ inputs.image }}:${{ inputs.flavour }}
|
||||||
${{ inputs.image }}:${{ matrix.package }}_${{ env.RELEASE_VERSION }}
|
${{ inputs.image }}:${{ inputs.flavour }}_${{ env.RELEASE_VERSION }}
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.version=${{ env.RELEASE_VERSION }}
|
org.opencontainers.image.version=${{ env.RELEASE_VERSION }}
|
||||||
org.opencontainers.image.created=${{ env.BUILD_DATE }}
|
org.opencontainers.image.created=${{ env.BUILD_DATE }}
|
||||||
@ -106,16 +110,16 @@ jobs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Build and push ${{ matrix.package }} (legacy)
|
- name: Build and push ${{ inputs.flavour }} (legacy)
|
||||||
if: inputs.release
|
if: inputs.release
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
target: ${{ matrix.package }}
|
target: ${{ inputs.flavour }}
|
||||||
tags: |
|
tags: |
|
||||||
fluencelabs/rust-peer:${{ matrix.package }}
|
fluencelabs/rust-peer:${{ inputs.flavour }}
|
||||||
fluencelabs/rust-peer:${{ matrix.package }}_${{ env.RELEASE_VERSION }}
|
fluencelabs/rust-peer:${{ inputs.flavour }}_${{ env.RELEASE_VERSION }}
|
||||||
labels: |
|
labels: |
|
||||||
org.opencontainers.image.version=${{ env.RELEASE_VERSION }}
|
org.opencontainers.image.version=${{ env.RELEASE_VERSION }}
|
||||||
org.opencontainers.image.created=${{ env.BUILD_DATE }}
|
org.opencontainers.image.created=${{ env.BUILD_DATE }}
|
||||||
@ -123,13 +127,13 @@ jobs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Build and push ${{ matrix.package }}
|
- name: Build and push ${{ inputs.flavour }}
|
||||||
if: ${{ matrix.package == 'ipfs' && inputs.release }}
|
if: ${{ matrix.package == 'ipfs' && inputs.release }}
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
target: ${{ matrix.package }}
|
target: ${{ inputs.flavour }}
|
||||||
tags: |
|
tags: |
|
||||||
${{ inputs.image }}:latest
|
${{ inputs.image }}:latest
|
||||||
${{ inputs.image }}:${{ env.RELEASE_VERSION }}
|
${{ inputs.image }}:${{ env.RELEASE_VERSION }}
|
||||||
@ -143,7 +147,7 @@ jobs:
|
|||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
if: ${{ matrix.package == 'ipfs' && inputs.release }}
|
if: ${{ inputs.flavour == 'ipfs' && inputs.release }}
|
||||||
uses: peter-evans/dockerhub-description@v3
|
uses: peter-evans/dockerhub-description@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ env.DOCKER_USERNAME }}
|
username: ${{ env.DOCKER_USERNAME }}
|
||||||
@ -154,10 +158,10 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
cat <<'SNAPSHOT' >> $GITHUB_STEP_SUMMARY
|
cat <<'SNAPSHOT' >> $GITHUB_STEP_SUMMARY
|
||||||
## nox ${{ matrix.package }}
|
## nox ${{ inputs.flavour }}
|
||||||
digest: `${{ steps.docker.outputs.digest }}`
|
digest: `${{ steps.docker.outputs.digest }}`
|
||||||
```
|
```
|
||||||
${{ inputs.image }}:${{ matrix.package }}
|
${{ inputs.image }}:${{ inputs.flavour }}
|
||||||
${{ inputs.image }}:${{ matrix.package }}_${{ env.RELEASE_VERSION }}
|
${{ inputs.image }}:${{ inputs.flavour }}_${{ env.RELEASE_VERSION }}
|
||||||
```
|
```
|
||||||
SNAPSHOT
|
SNAPSHOT
|
||||||
|
82
.github/workflows/e2e.yml
vendored
Normal file
82
.github/workflows/e2e.yml
vendored
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
name: "e2e"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- "**.md"
|
||||||
|
- ".github/**"
|
||||||
|
- "!.github/workflows/e2e.yml"
|
||||||
|
- "!.github/workflows/container.yml"
|
||||||
|
types:
|
||||||
|
- "labeled"
|
||||||
|
- "synchronize"
|
||||||
|
- "opened"
|
||||||
|
- "reopened"
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
paths-ignore:
|
||||||
|
- "**.md"
|
||||||
|
- ".github/**"
|
||||||
|
- "!.github/workflows/e2e.yml"
|
||||||
|
- "!.github/workflows/container.yml"
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOCKER_BUILDKIT: 1
|
||||||
|
FORCE_COLOR: 1
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
version:
|
||||||
|
name: "Generate snapshot id"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
github.event_name == 'push' ||
|
||||||
|
(
|
||||||
|
contains(github.event.pull_request.labels.*.name, 'e2e') &&
|
||||||
|
!github.event.pull_request.head.repo.fork
|
||||||
|
)
|
||||||
|
outputs:
|
||||||
|
id: ${{ steps.version.outputs.id }}
|
||||||
|
steps:
|
||||||
|
- name: Generate snapshot version
|
||||||
|
id: version
|
||||||
|
uses: fluencelabs/github-actions/generate-snapshot-id@main
|
||||||
|
|
||||||
|
flavours:
|
||||||
|
name: "snapshot"
|
||||||
|
needs: version
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
flavour:
|
||||||
|
- ipfs
|
||||||
|
- rich
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
uses: ./.github/workflows/container.yml
|
||||||
|
with:
|
||||||
|
image: "docker.fluence.dev/nox-distro"
|
||||||
|
flavour: ${{ matrix.flavour }}
|
||||||
|
version: ${{ needs.version.outputs.id }}
|
||||||
|
|
||||||
|
snapshot:
|
||||||
|
needs: version
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
uses: ./.github/workflows/container.yml
|
||||||
|
with:
|
||||||
|
image: "docker.fluence.dev/nox-distro"
|
||||||
|
flavour: minimal
|
||||||
|
version: ${{ needs.version.outputs.id }}
|
||||||
|
|
||||||
|
fluence-cli:
|
||||||
|
needs:
|
||||||
|
- snapshot
|
||||||
|
uses: fluencelabs/fluence-cli/.github/workflows/tests.yml@main
|
||||||
|
with:
|
||||||
|
rust-peer-image: "${{ needs.snapshot.outputs.nox-image }}"
|
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@ -38,12 +38,21 @@ jobs:
|
|||||||
publish:
|
publish:
|
||||||
if: needs.release-please.outputs.release-created
|
if: needs.release-please.outputs.release-created
|
||||||
needs: release-please
|
needs: release-please
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
flavour:
|
||||||
|
- minimal
|
||||||
|
- ipfs
|
||||||
|
- rich
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
uses: ./.github/workflows/container.yml
|
uses: ./.github/workflows/container.yml
|
||||||
with:
|
with:
|
||||||
version: ${{ needs.release-please.outputs.version }}
|
version: ${{ needs.release-please.outputs.version }}
|
||||||
|
flavour: ${{ matrix.flavour }}
|
||||||
release: true
|
release: true
|
||||||
|
|
||||||
update-release:
|
update-release:
|
||||||
|
34
.github/workflows/snapshot.yml
vendored
34
.github/workflows/snapshot.yml
vendored
@ -1,34 +0,0 @@
|
|||||||
name: "snapshot"
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- "!**.md"
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "main"
|
|
||||||
|
|
||||||
env:
|
|
||||||
DOCKER_BUILDKIT: 1
|
|
||||||
FORCE_COLOR: 1
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
version:
|
|
||||||
name: "Generate snapshot id"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
id: ${{ steps.version.outputs.id }}
|
|
||||||
steps:
|
|
||||||
- name: Generate snapshot version
|
|
||||||
id: version
|
|
||||||
uses: fluencelabs/github-actions/generate-snapshot-id@main
|
|
||||||
|
|
||||||
snapshot:
|
|
||||||
needs: version
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
uses: ./.github/workflows/container.yml
|
|
||||||
with:
|
|
||||||
image: "docker.fluence.dev/distro"
|
|
||||||
version: ${{ needs.version.outputs.id }}
|
|
Loading…
x
Reference in New Issue
Block a user