Skip to content

Commit

Permalink
Merge pull request #35 from estesp/gha
Browse files Browse the repository at this point in the history
Migrate to GitHub Actions for CI
  • Loading branch information
stefanberger committed Mar 2, 2021
2 parents 0ae5c75 + d7e5784 commit 2a5ba68
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 90 deletions.
140 changes: 140 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

checks:
name: Project Checks
runs-on: ubuntu-18.04
timeout-minutes: 5

steps:
- uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/imgcrypt
fetch-depth: 25

- uses: containerd/project-checks@v1
with:
working-directory: src/github.com/containerd/imgcrypt

linters:
name: Linters
runs-on: ${{ matrix.os }}
timeout-minutes: 10

strategy:
matrix:
go-version: [1.16]
os: [ubuntu-18.04]

steps:
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/imgcrypt

- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- uses: golangci/golangci-lint-action@v2
with:
version: v1.29
working-directory: src/github.com/containerd/imgcrypt

tests:
name: Linux Tests
runs-on: ubuntu-18.04
timeout-minutes: 15
needs: [linters, checks]

steps:
- uses: actions/checkout@v2
with:
repository: containerd/containerd
path: src/github.com/containerd/containerd

- uses: actions/checkout@v2
with:
path: src/github.com/containerd/imgcrypt

- uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Dependencies
shell: bash
run: |
sudo apt install gnutls-bin softhsm2 libseccomp-dev
make binaries
sudo make install
sudo rm /usr/local/bin/ctr
mkdir ../../lumjjb && pushd ../../lumjjb
git clone https://github.com/lumjjb/simple-ocicrypt-keyprovider && cd simple-ocicrypt-keyprovider
make
sudo cp simple_crypt /usr/local/bin
popd
RUNC_COMMIT=$(grep opencontainers/runc go.mod | awk '{print $2}')
pushd ../..
rm -fR opencontainers/runc && mkdir -p opencontainers && cd opencontainers
git clone https://github.com/opencontainers/runc.git && cd runc
git checkout "${RUNC_COMMIT}"
make BUILDTAGS='apparmor seccomp selinux' runc
sudo make install
popd
working-directory: src/github.com/containerd/containerd

- run: |
make test
make
CONTAINERD=$(type -P containerd) KEYPROVIDER=/usr/local/bin/simple_crypt ./script/tests/test_encryption.sh
working-directory: src/github.com/containerd/imgcrypt
windows-tests:
name: Windows Tests
runs-on: windows-2019
timeout-minutes: 15
needs: [linters, checks]

steps:
- uses: actions/checkout@v2
with:
path: src/github.com/containerd/imgcrypt

- uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- run: |
make test
make
working-directory: src/github.com/containerd/imgcrypt

0 comments on commit 2a5ba68

Please sign in to comment.