Skip to content

Commit

Permalink
Update and rename first.yml to artifact.yml
Browse files Browse the repository at this point in the history
add exercise yml file
  • Loading branch information
TomPughe authored Jun 18, 2024
1 parent 13d38bb commit 2cb0281
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 21 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: artifact

on: [push]

env:
FILE_NAME: hello-server

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Check out code
uses: actions/checkout@v1

- name: Build ${{ env.FILE_NAME }} for ubuntu-latest
run: go build ${{ env.FILE_NAME }}.go

- name: Build ${{ env.FILE_NAME }} for windows-latest
run: GOOS=windows GOARCH=amd64 go build ${{ env.FILE_NAME }}.go

- name: Upload artifact for linux
uses: actions/[email protected]
with:
name: linux
path: ./${{ env.FILE_NAME }}

- name: Upload artifact for windows
uses: actions/[email protected]
with:
name: windows
path: ./${{ env.FILE_NAME }}.exe

test-linux:
name: Test Linux
runs-on: [ubuntu-latest]
needs: [build]
steps:

- name: Check out code
uses: actions/checkout@v1

- name: Download artifact
uses: actions/[email protected]
with:
name: linux

- name: Test ${{ env.FILE_NAME }}
run: source ./test.sh

test-windows:
name: Test Windows
runs-on: [windows-latest]
needs: [build]
steps:

- name: Check out code
uses: actions/checkout@v1

- name: Download artifact
uses: actions/[email protected]
with:
name: windows

- name: Test ${{ env.FILE_NAME }}
run: windows/${{ env.FILE_NAME }}.exe
21 changes: 0 additions & 21 deletions .github/workflows/first.yml

This file was deleted.

0 comments on commit 2cb0281

Please sign in to comment.