mirror of
https://github.com/NexVeridian/wikidata-to-surrealdb.git
synced 2025-09-02 01:49:13 +00:00
swap to crane
This commit is contained in:
parent
afc20907a6
commit
b402e3f503
11 changed files with 4695 additions and 112 deletions
28
.github/workflows/crane.yml
vendored
Normal file
28
.github/workflows/crane.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
# https://github.com/nextest-rs/reuse-build-partition-example
|
||||
# https://keliris.dev/articles/setup-rust-github-actions
|
||||
|
||||
name: crane
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: 0 0 * * 1
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: check
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
- run: nix flake check --all-systems
|
73
.github/workflows/docker.yml
vendored
73
.github/workflows/docker.yml
vendored
|
@ -1,19 +1,15 @@
|
|||
name: Docker
|
||||
name: docker
|
||||
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [nextest]
|
||||
workflows: [crane]
|
||||
branches: [main]
|
||||
types:
|
||||
- completed
|
||||
# schedule:
|
||||
# - cron: 0 0 * * 1
|
||||
# push:
|
||||
# branches: [ "main" ]
|
||||
# branches: ["main"]
|
||||
# # Publish semver tags as releases.
|
||||
# tags: [ 'v*.*.*' ]
|
||||
# pull_request:
|
||||
|
@ -41,25 +37,22 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Install the cosign tool except on PR
|
||||
# https://github.com/sigstore/cosign-installer
|
||||
- name: Install cosign
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
|
||||
with:
|
||||
cosign-release: "v2.1.1"
|
||||
# Install Nix
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
|
||||
# Set up BuildKit Docker container builder to be able to build
|
||||
# multi-platform images and export cache
|
||||
# https://github.com/docker/setup-buildx-action
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# Login against a Docker registry except on PR
|
||||
# https://github.com/docker/login-action
|
||||
- name: Log into registry ${{ env.REGISTRY }}
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
|
@ -69,41 +62,27 @@ jobs:
|
|||
# https://github.com/docker/metadata-action
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
# Build Nix package
|
||||
- name: Build Nix package
|
||||
run: nix build .#dockerImage
|
||||
|
||||
# https://github.com/orgs/community/discussions/25768#discussioncomment-3249183
|
||||
- name: downcase REPO
|
||||
- name: Downcase REPO
|
||||
run: |
|
||||
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
|
||||
echo "REPO=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
|
||||
|
||||
# Build and push Docker image with Buildx (don't push on PR)
|
||||
# https://github.com/docker/build-push-action
|
||||
- name: Build and push Docker image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
# tags: ${{ steps.meta.outputs.tags }}
|
||||
# tags: ${{ env.REGISTRY }}/${{ github.repository }}:latest
|
||||
tags: ${{ env.REGISTRY }}/${{ env.REPO }}:latest
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
- name: Strip REPO Username
|
||||
run: |
|
||||
STRIP_REPO_USERNAME=$(echo "${{ env.REPO }}" | sed 's/nexveridian\///')
|
||||
echo "STRIP_REPO_USERNAME=${STRIP_REPO_USERNAME}" >> ${GITHUB_ENV}
|
||||
|
||||
# # Sign the resulting Docker image digest except on PRs.
|
||||
# # This will only write to the public Rekor transparency log when the Docker
|
||||
# # repository is public to avoid leaking data. If you would like to publish
|
||||
# # transparency data even for private images, pass --force to cosign below.
|
||||
# # https://github.com/sigstore/cosign
|
||||
# - name: Sign the published Docker image
|
||||
# if: ${{ github.event_name != 'pull_request' }}
|
||||
# env:
|
||||
# # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
|
||||
# TAGS: ${{ steps.meta.outputs.tags }}
|
||||
# DIGEST: ${{ steps.build-and-push.outputs.digest }}
|
||||
# # This step uses the identity token to provision an ephemeral certificate
|
||||
# # against the sigstore community Fulcio instance.
|
||||
# run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
|
||||
# https://github.com/docker/build-push-action/issues/538
|
||||
- name: Push and tag Docker image
|
||||
run: |
|
||||
docker load < result
|
||||
docker tag ${{ env.STRIP_REPO_USERNAME }}:latest ${{ env.REGISTRY }}/${{ env.REPO }}:latest
|
||||
docker push ${{ env.REGISTRY }}/${{ env.REPO }}:latest
|
||||
|
|
45
.github/workflows/nextest.yml
vendored
45
.github/workflows/nextest.yml
vendored
|
@ -1,45 +0,0 @@
|
|||
# https://github.com/nextest-rs/reuse-build-partition-example
|
||||
# https://keliris.dev/articles/setup-rust-github-actions
|
||||
|
||||
name: nextest
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: 0 0 * * 1
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
run-tests:
|
||||
name: run tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# - uses: rui314/setup-mold@v1
|
||||
- name: install mold
|
||||
run: sudo apt-get install -y musl-tools musl-dev libssl-dev clang mold
|
||||
# https://github.com/moonrepo/setup-rust
|
||||
- uses: moonrepo/setup-rust@v1
|
||||
with:
|
||||
bins: cargo-nextest
|
||||
- name: Run tests
|
||||
run: cargo nextest run -E "all() - test(get_api) - kind(bin)"
|
||||
|
||||
clippy:
|
||||
name: clippy
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
# - uses: rui314/setup-mold@v1
|
||||
- name: install mold
|
||||
run: sudo apt-get install -y musl-tools musl-dev libssl-dev clang mold
|
||||
- uses: moonrepo/setup-rust@v1
|
||||
with:
|
||||
components: clippy
|
||||
- name: clippy
|
||||
run: cargo clippy
|
Loading…
Add table
Add a link
Reference in a new issue