mihaialexandrescu is learning GitHub Actions #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: flow-01 | |
run-name: ${{ github.actor }} is learning GitHub Actions | |
on: [push, workflow_dispatch] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
job-01: | |
runs-on: ubuntu-latest # github.com/actions/runner-images | |
container: | |
image: ubuntu:latest | |
options: --cpus 1 | |
timeout-minutes: 5 | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Install git | |
run: apt update && apt install -y git && git version | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'gomodule01/go.mod' | |
cache: false | |
cache-dependency-path: "**/go.sum" | |
- name: Expected failure | |
run: exit 5 | |
continue-on-error: true | |
- name: Display /etc/lsb-release | |
run: cat /etc/lsb-release | |
- name: Fix x509 issue | |
run: apt update && apt install -y --no-install-recommends ca-certificates | |
- name: Install git | |
run: apt install -y git && git version | |
- name: Show git config | |
run: git config --list --show-origin | |
- name: Check go mod tidy | |
shell: bash | |
run: | | |
set -v | |
git config --system --add safe.directory "$GITHUB_WORKSPACE" | |
git config --system --add safe.directory "$PWD" | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
sleep 2 | |
git config --list --show-origin | |
ls -lAh | |
echo "github_workspace=$GITHUB_WORKSPACE" | |
echo "p_w_d=$PWD" | |
git diff --name-status | |
- name: Run gomodule01 | |
run: cd gomodule01 ; go run . | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.58 | |
working-directory: gomodule01 | |
skip-cache: true | |
skip-save-cache: true | |
args: --timeout=2m | |