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

CI on PR #345

Closed
wants to merge 3 commits into from
Closed
Changes from 2 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
51 changes: 42 additions & 9 deletions .github/workflows/make-all.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,75 @@
on: push
name: make all

on:
push:
pull_request:
branches:
- master
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line LGTM, but I don’t think we need other changes

Copy link
Author

@nathanblair nathanblair Aug 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the checkout action does actually do a lot more in less lines in this case. I'm used to just issuing clone commands directly; forgot that action would handle figuring out refs for different events.

Let me tackle the revert of these other lines tomorrow morning.


jobs:
makeall:
name: make all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Determine ref
id: ref
run: |
ref=""

if [ "${{ github.event_name }}" == "push" ]; then
full_ref="${{ github.ref }}"
ref_without_ref="${full_ref##refs/}"
ref_without_heads="${ref_without_ref##heads/}"
ref="${ref_without_heads##tags/}"
elif [ "${{ github.event_name }}" == "pull_request" ]; then
ref="${{ github.head_ref }}"
else
echo "Something went VERY wrong!"
exit 5
fi

echo "Ref: ${ref}"
echo "::set-output name=ref::${ref}"

- name: Clone code
run: git clone --depth=1 --branch="${{ steps.ref.outputs.ref }}" -c core.autocrlf=false https://github.com/${{ github.repository }} .

- name: install deps
shell: bash
run: |
sudo apt install -y \
libseccomp-dev \
parallel \
uidmap \
pigz \
--no-install-recommends
shell: bash

- uses: actions/setup-go@v2
with:
go-version: '^1.13.1' # The Go version to download (if necessary) and use.
go-version: "^1.13.1" # The Go version to download (if necessary) and use.

- name: install go tools
shell: bash
run: |
go get golang.org/x/lint/golint
go get honnef.co/go/tools/cmd/staticcheck
go get -u github.com/go-bindata/go-bindata/go-bindata
sudo mkdir -p /run/runc
sudo chown runner:runner -R /run/runc
shell: bash

- name: make all
run: make all
shell: bash
run: make all

- name: Run Test Coverage
shell: bash
run: |
make cover
bash <(curl -s https://codecov.io/bash)
shell: bash

- name: Run e2e Tests
env:
STATE_DIR: $HOME/img
run: |
make install
./contrib/e2e-dockerfiles-build-test.sh
env:
STATE_DIR: $HOME/img