Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 0.2.9 updates #105

Merged
merged 4 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 43 additions & 42 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,67 @@ on:
push:
branches:
- main
- dev-*
pull_request: {}

jobs:
cpp-lib:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Login to GitHub Container Registry
run: ocipkg login -u ${{ github.repository_owner }} -p ${{ github.token }} https://ghcr.io
- name: Login to GitHub Container Registry
run: ocipkg login -u ${{ github.repository_owner }} -p ${{ github.token }} https://ghcr.io

- name: Build static library
run: |
cd examples/cpp/lib
cmake -Bbuild
cmake --build build/ --target ocipkg
ocipkg push build/ocipkg_static_cpp.tar
- name: Build static library
run: |
cd examples/cpp/lib
cmake -Bbuild
cmake --build build/ --target ocipkg
ocipkg push build/ocipkg_static_cpp.tar

rust-lib:
runs-on: ubuntu-22.04
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Login to GitHub Container Registry
run: ocipkg login -u ${{ github.repository_owner }} -p ${{ github.token }} https://ghcr.io
- name: Login to GitHub Container Registry
run: ocipkg login -u ${{ github.repository_owner }} -p ${{ github.token }} https://ghcr.io

- name: Build and publish a container with cargo-ocipkg
run: |
cd examples/rust/lib
cargo ocipkg build --release
cargo ocipkg publish --release
- name: Build and publish a container with cargo-ocipkg
run: |
cd examples/rust/lib
cargo ocipkg build --release
cargo ocipkg publish --release

rust-exe:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Login to GitHub Container Registry
run: ocipkg login -u ${{ github.repository_owner }} -p ${{ github.token }} https://ghcr.io
- name: Login to GitHub Container Registry
run: ocipkg login -u ${{ github.repository_owner }} -p ${{ github.token }} https://ghcr.io

- name: Build rust-exe example
run: |
cd examples/rust/exe
cargo run
- name: Build rust-exe example
run: |
cd examples/rust/exe
cargo run
8 changes: 4 additions & 4 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: '.github/markdown-link-check.json'
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: ".github/markdown-link-check.json"
161 changes: 81 additions & 80 deletions .github/workflows/ocipkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,100 +4,101 @@ on:
push:
branches:
- main
- dev-*
pull_request: {}

jobs:
pack:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: pack src/
run: |
ocipkg pack ocipkg/src/ out.tar -t test_repo/testing:tag1
- name: Testing podman can load the generated container
run: |
podman load < out.tar
podman images | grep test_repo/testing | grep tag1
- name: pack src/
run: |
ocipkg pack ocipkg/src/ out.tar -t test_repo/testing:tag1
- name: Testing podman can load the generated container
run: |
podman load < out.tar
podman images | grep test_repo/testing | grep tag1

load:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Create test oci-archive using podman
run: |
podman pull alpine
podman save -o oci-alpine.tar --format oci-archive alpine
- name: load oci-archive
run: |
ocipkg load oci-alpine.tar
- name: Show alpine version
run: cat $HOME/.local/share/ocipkg/docker.io/library/alpine/__latest/etc/alpine-release
- name: Create test oci-archive using podman
run: |
podman pull alpine
podman save -o oci-alpine.tar --format oci-archive alpine
- name: load oci-archive
run: |
ocipkg load oci-alpine.tar
- name: Show alpine version
run: cat $HOME/.local/share/ocipkg/docker.io/library/alpine/__latest/etc/alpine-release

get:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: get image from ghcr.io
run: |
ocipkg login -u ${{ github.repository_owner }} -p ${{ github.token }} https://ghcr.io
ocipkg get ghcr.io/termoshtt/ocipkg/dynamic/rust:1d23f83
- name: get image from ghcr.io
run: |
ocipkg login -u ${{ github.repository_owner }} -p ${{ github.token }} https://ghcr.io
ocipkg get ghcr.io/termoshtt/ocipkg/dynamic/rust:1d23f83

get-anonymous:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: get image from ghcr.io
run: |
ocipkg get ghcr.io/termoshtt/ocipkg/dynamic/rust:1d23f83
- name: get image from ghcr.io
run: |
ocipkg get ghcr.io/termoshtt/ocipkg/dynamic/rust:1d23f83

list:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Setup registry
run: |
./test/fixture.sh
- name: get image
run: |
ocipkg get localhost:5000/test_repo:tag1
ocipkg get localhost:5000/test_repo:tag2
- name: list
run: test $(ocipkg list | wc -l) -eq 2
- name: Setup registry
run: |
./test/fixture.sh
- name: get image
run: |
ocipkg get localhost:5000/test_repo:tag1
ocipkg get localhost:5000/test_repo:tag2
- name: list
run: test $(ocipkg list | wc -l) -eq 2

services:
registry:
Expand All @@ -108,20 +109,20 @@ jobs:
push:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: install
args: --path=ocipkg-cli/ -f
- name: Add path
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: pack src/ and push
run: |
ocipkg pack ocipkg/src out.tar -t localhost:5000/test_repo:new_tag
ocipkg push out.tar
- name: Test image has been pushed
run: curl -sf localhost:5000/v2/test_repo/tags/list | jq -e '.tags[] | select(test("new_tag"))'
- name: pack src/ and push
run: |
ocipkg pack ocipkg/src out.tar -t localhost:5000/test_repo:new_tag
ocipkg push out.tar
- name: Test image has been pushed
run: curl -sf localhost:5000/v2/test_repo/tags/list | jq -e '.tags[] | select(test("new_tag"))'

services:
registry:
Expand Down
54 changes: 27 additions & 27 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
override: true
- uses: actions-rs/cargo@v1
with:
command: test
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
override: true
- uses: actions-rs/cargo@v1
with:
command: test

with-registry:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup registry
run: |
./test/fixture.sh
- uses: actions-rs/cargo@v1
with:
command: test
args: -- --include-ignored
- uses: actions/checkout@v4
- name: Setup registry
run: |
./test/fixture.sh
- uses: actions-rs/cargo@v1
with:
command: test
args: -- --include-ignored
services:
registry:
image: registry:2
Expand All @@ -41,16 +41,16 @@ jobs:
check-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

clippy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: clippy
- uses: actions/checkout@v4
- uses: actions-rs/cargo@v1
with:
command: clippy
Loading