Skip to content

Commit

Permalink
purge
Browse files Browse the repository at this point in the history
  • Loading branch information
elpdt852 committed Mar 24, 2024
1 parent 182ae7a commit ed06e3e
Showing 1 changed file with 69 additions and 69 deletions.
138 changes: 69 additions & 69 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,75 +17,75 @@ jobs:
- uses: MyAlbum/purge-cache@v1
with:
max-age: 1
- uses: actions/checkout@v4
- name: Setup Nix
uses: ./.github/actions/setup-nix
- name: Run linter
run: nix run .#lint-${{ matrix.linter }}
# - uses: actions/checkout@v4
# - name: Setup Nix
# uses: ./.github/actions/setup-nix
# - name: Run linter
# run: nix run .#lint-${{ matrix.linter }}

build:
runs-on: ubuntu-latest
strategy:
matrix:
package:
- nix-snapshotter
- image-hello
- image-redis
- image-redisWithShell
steps:
- uses: actions/checkout@v4
- name: Setup Nix
uses: ./.github/actions/setup-nix
- name: Build package
run: nix build .#${{ matrix.package }}
# build:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# package:
# - nix-snapshotter
# - image-hello
# - image-redis
# - image-redisWithShell
# steps:
# - uses: actions/checkout@v4
# - name: Setup Nix
# uses: ./.github/actions/setup-nix
# - name: Build package
# run: nix build .#${{ matrix.package }}

integration-test:
runs-on: nix-snapshotter-runner
strategy:
matrix:
test:
- snapshotter
- kubernetes
- k3s
- k3s-external
- k3s-rootless
- gvisor
needs: [lint, build]
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test')
steps:
- uses: actions/checkout@v4
- name: Setup Nix
uses: ./.github/actions/setup-nix
with:
enable-kvm: true
- name: Build snapshotter
run: nix build
- name: Run integration tests
run: nix run -L .#test-${{ matrix.test }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.test }}_build
path: build
if-no-files-found: ignore
retention-days: 1
# integration-test:
# runs-on: nix-snapshotter-runner
# strategy:
# matrix:
# test:
# - snapshotter
# - kubernetes
# - k3s
# - k3s-external
# - k3s-rootless
# - gvisor
# needs: [lint, build]
# if: contains(github.event.pull_request.labels.*.name, 'ok-to-test')
# steps:
# - uses: actions/checkout@v4
# - name: Setup Nix
# uses: ./.github/actions/setup-nix
# with:
# enable-kvm: true
# - name: Build snapshotter
# run: nix build
# - name: Run integration tests
# run: nix run -L .#test-${{ matrix.test }}
# - uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.test }}_build
# path: build
# if-no-files-found: ignore
# retention-days: 1

coverage-report:
runs-on: ubuntu-latest
needs: [integration-test]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: build
merge-multiple: true
- uses: actions/setup-go@v4
with: { go-version: '1.20' }
- name: Collect test coverage
run: |
mkdir -p "$PWD/build/go-cover/unit"
go test -cover ./... -args -test.gocoverdir="$PWD/build/go-cover/unit"
go tool covdata textfmt -i=`find ./build/go-cover -mindepth 1 -type d | paste -sd ","` -o ./build/go-cover/profile
echo "# Coverage report" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
go tool cover -func ./build/go-cover/profile >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
# coverage-report:
# runs-on: ubuntu-latest
# needs: [integration-test]
# steps:
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v4
# with:
# path: build
# merge-multiple: true
# - uses: actions/setup-go@v4
# with: { go-version: '1.20' }
# - name: Collect test coverage
# run: |
# mkdir -p "$PWD/build/go-cover/unit"
# go test -cover ./... -args -test.gocoverdir="$PWD/build/go-cover/unit"
# go tool covdata textfmt -i=`find ./build/go-cover -mindepth 1 -type d | paste -sd ","` -o ./build/go-cover/profile
# echo "# Coverage report" >> $GITHUB_STEP_SUMMARY
# echo '```' >> $GITHUB_STEP_SUMMARY
# go tool cover -func ./build/go-cover/profile >> $GITHUB_STEP_SUMMARY
# echo '```' >> $GITHUB_STEP_SUMMARY

0 comments on commit ed06e3e

Please sign in to comment.