From a6d19fbae98177e06d6d3f44922e1b08ad583bd5 Mon Sep 17 00:00:00 2001 From: Lucas TESSON Date: Wed, 10 Apr 2024 08:34:04 +0200 Subject: [PATCH] ci: improve CI workflow --- .github/workflows/ci.yaml | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a737407..11ce32f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,24 +5,13 @@ on: [push, pull_request] permissions: contents: read -jobs: - setup: - runs-on: ubuntu-latest - steps: - - name: Cancel previous - uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1 +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} +jobs: tests: - strategy: - matrix: - go-version: [1.x, 1.21.x] - platform: [ubuntu-latest] - include: - - go-version: 1.x - platform: ubuntu-latest - update-coverage: true - runs-on: ${{ matrix.platform }} - needs: [setup] + runs-on: ubuntu-latest services: ctfd: image: ctfd/ctfd:3.7.0@sha256:e4e886aa8f1051eeddcabe2115bc9a5f380be2b54034d5a119c44b177d6b8c57 @@ -35,7 +24,7 @@ jobs: - name: Setup Go uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: ${{ matrix.go-version }} + go-version-file: 'go.mod' - name: Cache go modules uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 @@ -75,12 +64,11 @@ jobs: go-lint: runs-on: ubuntu-latest - needs: [setup] steps: - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: - go-version: 1.21.x - + go-version-file: 'go.mod' + - name: go-lint uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0